<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name=Generator content="Microsoft Word 14 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:黑体;
	panose-1:2 1 6 9 6 1 1 1 1 1;}
@font-face
	{font-family:黑体;
	panose-1:2 1 6 9 6 1 1 1 1 1;}
@font-face
	{font-family:方正小标宋简体;}
@font-face
	{font-family:"\@黑体";
	panose-1:2 1 6 9 6 1 1 1 1 1;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:"\@方正小标宋简体";}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
h1
	{mso-style-link:"标题 1 Char";
	margin-top:17.0pt;
	margin-right:0cm;
	margin-bottom:16.5pt;
	margin-left:7.2pt;
	text-align:center;
	text-indent:-7.2pt;
	page-break-after:avoid;
	font-size:22.0pt;
	font-family:宋体;
	font-weight:bold;}
h2
	{mso-style-link:"标题 2 Char";
	margin-top:13.0pt;
	margin-right:0cm;
	margin-bottom:13.0pt;
	margin-left:0cm;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:0cm;
	page-break-after:avoid;
	font-size:16.0pt;
	font-family:"Arial","sans-serif";
	font-weight:bold;}
h3
	{mso-style-link:"标题 3 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:0cm;
	page-break-after:avoid;
	font-size:14.0pt;
	font-family:"Arial","sans-serif";
	font-weight:bold;}
h4
	{mso-style-link:"标题 4 Char";
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:28.8pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-28.8pt;
	page-break-after:avoid;
	font-size:12.0pt;
	font-family:"Arial","sans-serif";
	font-weight:bold;}
h5
	{mso-style-link:"标题 5 Char";
	margin-top:14.0pt;
	margin-right:0cm;
	margin-bottom:14.5pt;
	margin-left:36.0pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-36.0pt;
	line-height:156%;
	page-break-after:avoid;
	font-size:14.0pt;
	font-family:宋体;
	font-weight:bold;}
h6
	{mso-style-link:"标题 6 Char";
	margin-top:12.0pt;
	margin-right:0cm;
	margin-bottom:3.2pt;
	margin-left:43.2pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-43.2pt;
	line-height:133%;
	page-break-after:avoid;
	font-size:12.0pt;
	font-family:"Arial","sans-serif";
	font-weight:bold;}
p.MsoHeading7, li.MsoHeading7, div.MsoHeading7
	{mso-style-link:"标题 7 Char";
	margin-top:12.0pt;
	margin-right:0cm;
	margin-bottom:3.2pt;
	margin-left:50.4pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-50.4pt;
	line-height:133%;
	page-break-after:avoid;
	font-size:12.0pt;
	font-family:宋体;
	font-weight:bold;}
p.MsoHeading8, li.MsoHeading8, div.MsoHeading8
	{mso-style-link:"标题 8 Char";
	margin-top:12.0pt;
	margin-right:0cm;
	margin-bottom:3.2pt;
	margin-left:57.6pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-72.0pt;
	line-height:133%;
	page-break-after:avoid;
	font-size:12.0pt;
	font-family:"Arial","sans-serif";}
p.MsoHeading9, li.MsoHeading9, div.MsoHeading9
	{mso-style-link:"标题 9 Char";
	margin-top:12.0pt;
	margin-right:0cm;
	margin-bottom:3.2pt;
	margin-left:64.8pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-79.2pt;
	line-height:133%;
	page-break-after:avoid;
	font-size:10.5pt;
	font-family:"Arial","sans-serif";}
p.MsoIndex1, li.MsoIndex1, div.MsoIndex1
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:10.5pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-10.5pt;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoIndex2, li.MsoIndex2, div.MsoIndex2
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:21.0pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-10.5pt;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoIndex3, li.MsoIndex3, div.MsoIndex3
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:31.5pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-10.5pt;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoIndex4, li.MsoIndex4, div.MsoIndex4
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:42.0pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-10.5pt;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoIndex5, li.MsoIndex5, div.MsoIndex5
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:52.5pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-10.5pt;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoIndex6, li.MsoIndex6, div.MsoIndex6
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:63.0pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-10.5pt;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoIndex7, li.MsoIndex7, div.MsoIndex7
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:73.5pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-10.5pt;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoIndex8, li.MsoIndex8, div.MsoIndex8
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:84.0pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-10.5pt;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoIndex9, li.MsoIndex9, div.MsoIndex9
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:94.5pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-10.5pt;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoToc1, li.MsoToc1, div.MsoToc1
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;
	font-weight:bold;}
p.MsoToc2, li.MsoToc2, div.MsoToc2
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:21.0pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoToc3, li.MsoToc3, div.MsoToc3
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:42.0pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoToc4, li.MsoToc4, div.MsoToc4
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:31.5pt;
	margin-bottom:.0001pt;
	font-size:9.0pt;
	font-family:宋体;}
p.MsoToc5, li.MsoToc5, div.MsoToc5
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:42.0pt;
	margin-bottom:.0001pt;
	font-size:9.0pt;
	font-family:宋体;}
p.MsoToc6, li.MsoToc6, div.MsoToc6
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:52.5pt;
	margin-bottom:.0001pt;
	font-size:9.0pt;
	font-family:宋体;}
p.MsoToc7, li.MsoToc7, div.MsoToc7
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:63.0pt;
	margin-bottom:.0001pt;
	font-size:9.0pt;
	font-family:宋体;}
p.MsoToc8, li.MsoToc8, div.MsoToc8
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:73.5pt;
	margin-bottom:.0001pt;
	font-size:9.0pt;
	font-family:宋体;}
p.MsoToc9, li.MsoToc9, div.MsoToc9
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:84.0pt;
	margin-bottom:.0001pt;
	font-size:9.0pt;
	font-family:宋体;}
p.MsoFootnoteText, li.MsoFootnoteText, div.MsoFootnoteText
	{mso-style-link:"脚注文本 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	layout-grid-mode:char;
	font-size:9.0pt;
	font-family:宋体;}
p.MsoCommentText, li.MsoCommentText, div.MsoCommentText
	{mso-style-link:"批注文字 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
	{mso-style-link:"页眉 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	layout-grid-mode:char;
	border:none;
	padding:0cm;
	font-size:9.0pt;
	font-family:宋体;}
p.MsoFooter, li.MsoFooter, div.MsoFooter
	{mso-style-link:"页脚 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	layout-grid-mode:char;
	font-size:9.0pt;
	font-family:宋体;}
p.MsoIndexHeading, li.MsoIndexHeading, div.MsoIndexHeading
	{mso-style-name:"索引标题\,索引类目\,索引类目1\,索引类目2";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoCaption, li.MsoCaption, div.MsoCaption
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:"Arial","sans-serif";}
p.MsoTof, li.MsoTof, div.MsoTof
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:42.0pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-21.0pt;
	font-size:10.5pt;
	font-family:宋体;}
span.MsoFootnoteReference
	{vertical-align:super;}
p.MsoList, li.MsoList, div.MsoList
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:21.0pt;
	margin-bottom:.0001pt;
	text-align:center;
	text-indent:-21.0pt;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoList2, li.MsoList2, div.MsoList2
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoList4, li.MsoList4, div.MsoList4
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.MsoDate, li.MsoDate, div.MsoDate
	{mso-style-link:"日期 Char";
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:5.0pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
a:link, span.MsoHyperlink
	{mso-style-name:"超链接\,超级链接";
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
p
	{mso-style-name:"普通\(网站\)\,普通 \(Web\)\,普通 \(Web\)1\,普通 \(Web\)2\,普通 \(Web\)3";
	margin-right:0cm;
	margin-left:0cm;
	font-size:12.0pt;
	font-family:宋体;}
pre
	{mso-style-name:"HTML 预设格式\,HTML 预先格式化\,HTML 预先格式化1\,HTML 预先格式化2\,HTML 预先格式化3";
	mso-style-link:"HTML 预设格式 Char\,HTML 预先格式化 Char\,HTML 预先格式化1 Char\,HTML 预先格式化2 Char\,HTML 预先格式化3 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:宋体;}
tt
	{font-family:黑体;}
p.MsoCommentSubject, li.MsoCommentSubject, div.MsoCommentSubject
	{mso-style-link:"批注主题 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.5pt;
	font-family:宋体;
	font-weight:bold;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-link:"批注框文本 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:9.0pt;
	font-family:宋体;}
p.1, li.1, div.1
	{mso-style-name:样式1;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:21.0pt;
	margin-bottom:.0001pt;
	text-align:center;
	text-indent:-21.0pt;
	font-size:10.5pt;
	font-family:宋体;}
p.a, li.a, div.a
	{mso-style-name:代码程序;
	mso-style-link:"代码程序 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:宋体;}
span.Char
	{mso-style-name:"代码程序 Char";
	mso-style-link:代码程序;
	font-family:宋体;}
p.a0, li.a0, div.a0
	{mso-style-name:图说明;
	mso-style-link:"图说明 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
span.Char0
	{mso-style-name:"图说明 Char";
	mso-style-link:图说明;
	font-family:宋体;}
p.0, li.0, div.0
	{mso-style-name:封面0;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:36.0pt;
	font-family:宋体;
	font-weight:bold;}
p.10, li.10, div.10
	{mso-style-name:封面1;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:18.0pt;
	font-family:宋体;
	font-weight:bold;}
p.11, li.11, div.11
	{mso-style-name:非标题1;
	margin-top:7.8pt;
	margin-right:0cm;
	margin-bottom:7.8pt;
	margin-left:0cm;
	text-align:center;
	font-size:22.0pt;
	font-family:宋体;
	font-weight:bold;}
p.a1, li.a1, div.a1
	{mso-style-name:文本居中;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.3CharChar, li.3CharChar, div.3CharChar
	{mso-style-name:"图中文字3 Char Char";
	mso-style-link:"图中文字3 Char Char Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	line-height:9.0pt;
	font-size:8.0pt;
	font-family:宋体;}
span.3CharCharChar
	{mso-style-name:"图中文字3 Char Char Char";
	mso-style-link:"图中文字3 Char Char";
	font-family:宋体;}
p.post, li.post, div.post
	{mso-style-name:邮件post;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:right;
	line-height:11.0pt;
	font-size:10.5pt;
	font-family:宋体;}
p.3, li.3, div.3
	{mso-style-name:图中字体3;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
span.3CharChar1CharCharChar
	{mso-style-name:"图中文字3 Char Char1 Char Char Char";
	font-family:宋体;}
span.3CharChar1CharChar
	{mso-style-name:"图中文字3 Char Char1 Char Char";
	font-family:宋体;}
p.5Char, li.5Char, div.5Char
	{mso-style-name:"图中文字5号 Char";
	mso-style-link:"图中文字5号 Char Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
span.5CharChar
	{mso-style-name:"图中文字5号 Char Char";
	mso-style-link:"图中文字5号 Char";
	font-family:宋体;}
p.5CharChar0, li.5CharChar0, div.5CharChar0
	{mso-style-name:"图中文字小5号 Char Char";
	mso-style-link:"图中文字小5号 Char Char Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:9.0pt;
	font-family:宋体;}
span.5CharCharChar
	{mso-style-name:"图中文字小5号 Char Char Char";
	mso-style-link:"图中文字小5号 Char Char";
	font-family:宋体;}
p.5Char0, li.5Char0, div.5Char0
	{mso-style-name:"图中文字小5号 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:9.0pt;
	font-family:宋体;}
p.5, li.5, div.5
	{mso-style-name:图中文字小5号;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	layout-grid-mode:char;
	font-size:9.0pt;
	font-family:宋体;}
p.2, li.2, div.2
	{mso-style-name:代码程序2;
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:宋体;}
p.20, li.20, div.20
	{mso-style-name:图说明2;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.21, li.21, div.21
	{mso-style-name:文本居中2;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.3CharCharCharCharChar, li.3CharCharCharCharChar, div.3CharCharCharCharChar
	{mso-style-name:"图中文字3 Char Char Char Char Char";
	mso-style-link:"图中文字3 Char Char Char Char Char Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	line-height:9.0pt;
	font-size:8.0pt;
	font-family:宋体;}
span.3CharCharCharCharCharChar
	{mso-style-name:"图中文字3 Char Char Char Char Char Char";
	mso-style-link:"图中文字3 Char Char Char Char Char";
	font-family:宋体;}
p.a2, li.a2, div.a2
	{mso-style-name:图居中;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.110, li.110, div.110
	{mso-style-name:"样式 标题 1 + 居中1";
	margin-right:0cm;
	margin-left:0cm;
	text-align:center;
	page-break-after:avoid;
	font-size:22.0pt;
	font-family:宋体;
	font-weight:bold;}
span.1Char
	{mso-style-name:"标题 1 Char";
	mso-style-link:"标题 1";
	font-weight:bold;}
p.22, li.22, div.22
	{mso-style-name:"样式 列表 2 + 居中";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.23, li.23, div.23
	{mso-style-name:列表2;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.50, li.50, div.50
	{mso-style-name:图中文字5号;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.111, li.111, div.111
	{mso-style-name:样式11;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:21.0pt;
	margin-bottom:.0001pt;
	text-align:center;
	text-indent:-21.0pt;
	font-size:10.5pt;
	font-family:宋体;}
p.12, li.12, div.12
	{mso-style-name:代码程序1;
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:宋体;}
p.13, li.13, div.13
	{mso-style-name:图说明1;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.01, li.01, div.01
	{mso-style-name:封面01;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:36.0pt;
	font-family:宋体;
	font-weight:bold;}
p.112, li.112, div.112
	{mso-style-name:封面11;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:18.0pt;
	font-family:宋体;
	font-weight:bold;}
p.113, li.113, div.113
	{mso-style-name:非标题11;
	margin-top:7.8pt;
	margin-right:0cm;
	margin-bottom:7.8pt;
	margin-left:0cm;
	text-align:center;
	font-size:22.0pt;
	font-family:宋体;
	font-weight:bold;}
p.14, li.14, div.14
	{mso-style-name:文本居中1;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.3Char1, li.3Char1, div.3Char1
	{mso-style-name:"图中文字3 Char1";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	line-height:9.0pt;
	font-size:8.0pt;
	font-family:宋体;}
p.post1, li.post1, div.post1
	{mso-style-name:邮件post1;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:right;
	line-height:11.0pt;
	font-size:10.5pt;
	font-family:宋体;}
p.31, li.31, div.31
	{mso-style-name:图中字体31;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
p.5Char1, li.5Char1, div.5Char1
	{mso-style-name:"图中文字5号 Char1";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.5CharChar1, li.5CharChar1, div.5CharChar1
	{mso-style-name:"图中文字小5号 Char Char1";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:9.0pt;
	font-family:宋体;}
p.5Char10, li.5Char10, div.5Char10
	{mso-style-name:"图中文字小5号 Char1";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:9.0pt;
	font-family:宋体;}
p.51, li.51, div.51
	{mso-style-name:图中文字小5号1;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:9.0pt;
	font-family:宋体;}
p.120, li.120, div.120
	{mso-style-name:样式12;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:21.0pt;
	margin-bottom:.0001pt;
	text-align:center;
	text-indent:-21.0pt;
	font-size:10.5pt;
	font-family:宋体;}
p.02, li.02, div.02
	{mso-style-name:封面02;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:36.0pt;
	font-family:宋体;
	font-weight:bold;}
p.121, li.121, div.121
	{mso-style-name:封面12;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:18.0pt;
	font-family:宋体;
	font-weight:bold;}
p.122, li.122, div.122
	{mso-style-name:非标题12;
	margin-top:7.8pt;
	margin-right:0cm;
	margin-bottom:7.8pt;
	margin-left:0cm;
	text-align:center;
	font-size:22.0pt;
	font-family:宋体;
	font-weight:bold;}
p.3Char2, li.3Char2, div.3Char2
	{mso-style-name:"图中文字3 Char2";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	line-height:9.0pt;
	font-size:8.0pt;
	font-family:宋体;}
p.post2, li.post2, div.post2
	{mso-style-name:邮件post2;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:right;
	line-height:11.0pt;
	font-size:10.5pt;
	font-family:宋体;}
p.32, li.32, div.32
	{mso-style-name:图中字体32;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
p.5Char2, li.5Char2, div.5Char2
	{mso-style-name:"图中文字小5号 Char2";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:9.0pt;
	font-family:宋体;}
p.52, li.52, div.52
	{mso-style-name:图中文字小5号2;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:9.0pt;
	font-family:宋体;}
p.3CharCharCharChar, li.3CharCharCharChar, div.3CharCharCharChar
	{mso-style-name:"图中文字3 Char Char Char Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	line-height:9.0pt;
	font-size:8.0pt;
	font-family:宋体;}
p.130, li.130, div.130
	{mso-style-name:样式13;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:21.0pt;
	margin-bottom:.0001pt;
	text-align:center;
	text-indent:-21.0pt;
	font-size:10.5pt;
	font-family:宋体;}
p.30, li.30, div.30
	{mso-style-name:代码程序3;
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:宋体;}
p.03, li.03, div.03
	{mso-style-name:封面03;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:36.0pt;
	font-family:宋体;
	font-weight:bold;}
p.131, li.131, div.131
	{mso-style-name:封面13;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:18.0pt;
	font-family:宋体;
	font-weight:bold;}
p.132, li.132, div.132
	{mso-style-name:非标题13;
	margin-top:7.8pt;
	margin-right:0cm;
	margin-bottom:7.8pt;
	margin-left:0cm;
	text-align:center;
	font-size:22.0pt;
	font-family:宋体;
	font-weight:bold;}
p.33, li.33, div.33
	{mso-style-name:文本居中3;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.3Char3, li.3Char3, div.3Char3
	{mso-style-name:"图中文字3 Char3";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	line-height:9.0pt;
	font-size:8.0pt;
	font-family:宋体;}
p.post3, li.post3, div.post3
	{mso-style-name:邮件post3;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:right;
	line-height:11.0pt;
	font-size:10.5pt;
	font-family:宋体;}
p.330, li.330, div.330
	{mso-style-name:图中字体33;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
p.5Char20, li.5Char20, div.5Char20
	{mso-style-name:"图中文字5号 Char2";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.5CharChar2, li.5CharChar2, div.5CharChar2
	{mso-style-name:"图中文字小5号 Char Char2";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:9.0pt;
	font-family:宋体;}
p.5Char3, li.5Char3, div.5Char3
	{mso-style-name:"图中文字小5号 Char3";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:9.0pt;
	font-family:宋体;}
p.53, li.53, div.53
	{mso-style-name:图中文字小5号3;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:9.0pt;
	font-family:宋体;}
p.3Char, li.3Char, div.3Char
	{mso-style-name:"图中文字3 Char";
	mso-style-link:"图中文字3 Char Char5";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	line-height:9.0pt;
	font-size:8.0pt;
	font-family:宋体;}
span.3CharChar5
	{mso-style-name:"图中文字3 Char Char5";
	mso-style-link:"图中文字3 Char";
	font-family:宋体;}
p.54, li.54, div.54
	{mso-style-name:图中文字小5紧密;
	margin:0cm;
	margin-bottom:.0001pt;
	line-height:9.0pt;
	text-autospace:ideograph-numeric;
	font-size:9.0pt;
	font-family:宋体;}
p.24, li.24, div.24
	{mso-style-name:居中2号粗宋体;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:22.0pt;
	font-family:宋体;
	font-weight:bold;}
p.15, li.15, div.15
	{mso-style-name:"样式 标题 1 + 居中";
	margin-top:17.0pt;
	margin-right:0cm;
	margin-bottom:16.5pt;
	margin-left:0cm;
	text-align:center;
	page-break-after:avoid;
	font-size:22.0pt;
	font-family:宋体;
	font-weight:bold;}
p.25, li.25, div.25
	{mso-style-name:"样式 标题 2 + 行距\: 单倍行距";
	margin-top:13.0pt;
	margin-right:0cm;
	margin-bottom:13.0pt;
	margin-left:28.9pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-28.9pt;
	page-break-after:avoid;
	font-size:16.0pt;
	font-family:"Arial","sans-serif";
	font-weight:bold;}
span.2Char
	{mso-style-name:"标题 2 Char";
	mso-style-link:"标题 2";
	font-family:"Arial","sans-serif";
	font-weight:bold;}
p.34, li.34, div.34
	{mso-style-name:列表3;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.35, li.35, div.35
	{mso-style-name:表3;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.4, li.4, div.4
	{mso-style-name:图说明4;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.40, li.40, div.40
	{mso-style-name:列表4;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:21.0pt;
	margin-bottom:.0001pt;
	text-align:center;
	text-indent:-21.0pt;
	font-size:10.5pt;
	font-family:宋体;}
p.41, li.41, div.41
	{mso-style-name:表4;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.55, li.55, div.55
	{mso-style-name:图说明5;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.56, li.56, div.56
	{mso-style-name:列表5;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.57, li.57, div.57
	{mso-style-name:表5;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.6, li.6, div.6
	{mso-style-name:列表6;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.60, li.60, div.60
	{mso-style-name:表6;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.61, li.61, div.61
	{mso-style-name:图说明6;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.7, li.7, div.7
	{mso-style-name:列表7;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.70, li.70, div.70
	{mso-style-name:图说明7;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.71, li.71, div.71
	{mso-style-name:表7;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.8, li.8, div.8
	{mso-style-name:列表8;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.9, li.9, div.9
	{mso-style-name:列表9;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.90, li.90, div.90
	{mso-style-name:图说明9;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.100, li.100, div.100
	{mso-style-name:列表10;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.101, li.101, div.101
	{mso-style-name:图说明10;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.114, li.114, div.114
	{mso-style-name:列表11;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.115, li.115, div.115
	{mso-style-name:图说明11;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.116, li.116, div.116
	{mso-style-name:表11;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.123, li.123, div.123
	{mso-style-name:列表12;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.124, li.124, div.124
	{mso-style-name:图说明12;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.133, li.133, div.133
	{mso-style-name:图说明13;
	mso-style-link:"图说明13 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
span.13Char
	{mso-style-name:"图说明13 Char";
	mso-style-link:图说明13;
	font-family:宋体;}
p.134, li.134, div.134
	{mso-style-name:列表13;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.26, li.26, div.26
	{mso-style-name:附录2;
	margin-top:13.0pt;
	margin-right:0cm;
	margin-bottom:13.0pt;
	margin-left:0cm;
	text-align:justify;
	text-justify:inter-ideograph;
	page-break-after:avoid;
	font-size:16.0pt;
	font-family:"Arial","sans-serif";
	font-weight:bold;}
p.36, li.36, div.36
	{mso-style-name:附录3;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	page-break-after:avoid;
	font-size:14.0pt;
	font-family:"Arial","sans-serif";
	font-weight:bold;}
span.3Char0
	{mso-style-name:"标题 3 Char";
	mso-style-link:"标题 3";
	font-family:"Arial","sans-serif";
	font-weight:bold;}
p.16, li.16, div.16
	{mso-style-name:附录1;
	margin-top:17.0pt;
	margin-right:0cm;
	margin-bottom:16.5pt;
	margin-left:0cm;
	text-align:center;
	page-break-after:avoid;
	font-size:22.0pt;
	font-family:宋体;
	font-weight:bold;}
p.17, li.17, div.17
	{mso-style-name:附录表1;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.42, li.42, div.42
	{mso-style-name:附录4;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	page-break-after:avoid;
	font-size:12.0pt;
	font-family:"Arial","sans-serif";
	font-weight:bold;}
span.4Char
	{mso-style-name:"标题 4 Char";
	mso-style-link:"标题 4";
	font-family:"Arial","sans-serif";
	font-weight:bold;}
p.a3, li.a3, div.a3
	{mso-style-name:附录图说明;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.27, li.27, div.27
	{mso-style-name:序标题2;
	margin-top:13.0pt;
	margin-right:0cm;
	margin-bottom:13.0pt;
	margin-left:28.8pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-28.8pt;
	page-break-after:avoid;
	font-size:16.0pt;
	font-family:"Arial","sans-serif";
	font-weight:bold;}
p.a4, li.a4, div.a4
	{mso-style-name:参考标题;
	margin-top:7.8pt;
	margin-right:0cm;
	margin-bottom:7.8pt;
	margin-left:0cm;
	text-align:center;
	page-break-after:avoid;
	font-size:22.0pt;
	font-family:宋体;
	font-weight:bold;}
p.18, li.18, div.18
	{mso-style-name:索引标题1;
	margin-top:7.8pt;
	margin-right:0cm;
	margin-bottom:7.8pt;
	margin-left:0cm;
	text-align:center;
	page-break-after:avoid;
	font-size:22.0pt;
	font-family:宋体;
	font-weight:bold;}
p.19, li.19, div.19
	{mso-style-name:列表1;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:21.25pt;
	margin-bottom:.0001pt;
	text-align:center;
	text-indent:-21.25pt;
	font-size:10.5pt;
	font-family:宋体;}
p.1a, li.1a, div.1a
	{mso-style-name:表1;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:21.25pt;
	margin-bottom:.0001pt;
	text-align:center;
	text-indent:-21.25pt;
	font-size:10.5pt;
	font-family:宋体;}
p.37, li.37, div.37
	{mso-style-name:图说明3;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.62, li.62, div.62
	{mso-style-name:表中字体6号;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	layout-grid-mode:char;
	font-size:7.5pt;
	font-family:宋体;}
p.a5, li.a5, div.a5
	{mso-style-name:正文代码;
	mso-style-link:"正文代码 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
span.Char1
	{mso-style-name:"正文代码 Char";
	mso-style-link:正文代码;
	font-family:宋体;}
p.43, li.43, div.43
	{mso-style-name:"样式 标题 4 +";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	page-break-after:avoid;
	font-size:12.0pt;
	font-family:"Arial","sans-serif";
	font-weight:bold;}
p.140, li.140, div.140
	{mso-style-name:表14;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:21.25pt;
	margin-bottom:.0001pt;
	text-align:center;
	text-indent:-21.25pt;
	font-size:10.5pt;
	font-family:宋体;}
p.141, li.141, div.141
	{mso-style-name:图说明14;
	mso-style-link:"图说明14 Char";
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:21.25pt;
	margin-bottom:.0001pt;
	text-align:center;
	text-indent:-21.25pt;
	font-size:10.5pt;
	font-family:宋体;}
span.14Char
	{mso-style-name:"图说明14 Char";
	mso-style-link:图说明14;
	font-family:宋体;}
p.a6, li.a6, div.a6
	{mso-style-name:文件目录表;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
p.a7, li.a7, div.a7
	{mso-style-name:"样式 正文 +";
	mso-style-link:"样式 正文 + Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
span.Char2
	{mso-style-name:"样式 正文 + Char";
	mso-style-link:"样式 正文 +";
	font-family:"Times New Roman","serif";}
p.a8, li.a8, div.a8
	{mso-style-name:表格题注;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.a9, li.a9, div.a9
	{mso-style-name:列表题注;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:"Arial","sans-serif";}
p.aa, li.aa, div.aa
	{mso-style-name:图题注;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:"Arial","sans-serif";}
p.ab, li.ab, div.ab
	{mso-style-name:程序题注;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:"Arial","sans-serif";}
p.ac, li.ac, div.ac
	{mso-style-name:框中文字;
	margin-top:0cm;
	margin-right:21.0pt;
	margin-bottom:0cm;
	margin-left:21.0pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	border:none;
	padding:0cm;
	font-size:9.0pt;
	font-family:宋体;}
p.125, li.125, div.125
	{mso-style-name:"样式 标题 1 + 居中2";
	margin-top:17.0pt;
	margin-right:0cm;
	margin-bottom:16.5pt;
	margin-left:0cm;
	text-align:center;
	page-break-after:avoid;
	font-size:22.0pt;
	font-family:宋体;
	font-weight:bold;}
p.ad, li.ad, div.ad
	{mso-style-name:"样式 题注 + 宋体 五号 居中";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:黑体;}
p.1b, li.1b, div.1b
	{mso-style-name:序标题1;
	margin-top:17.0pt;
	margin-right:0cm;
	margin-bottom:16.5pt;
	margin-left:0cm;
	line-height:240%;
	page-break-after:avoid;
	font-size:16.0pt;
	font-family:宋体;
	font-weight:bold;}
p.38, li.38, div.38
	{mso-style-name:序标题3;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	page-break-after:avoid;
	font-size:12.0pt;
	font-family:方正小标宋简体;}
p.63, li.63, div.63
	{mso-style-name:表中文字6号;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:7.5pt;
	font-family:宋体;}
p.64, li.64, div.64
	{mso-style-name:图中文字6号左对齐;
	margin:0cm;
	margin-bottom:.0001pt;
	line-height:10.0pt;
	layout-grid-mode:char;
	font-size:7.5pt;
	font-family:宋体;}
p.65, li.65, div.65
	{mso-style-name:图中文字6号;
	mso-style-link:"图中文字6号 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	line-height:10.0pt;
	layout-grid-mode:char;
	font-size:7.5pt;
	font-family:宋体;}
span.6Char
	{mso-style-name:"图中文字6号 Char";
	mso-style-link:图中文字6号;
	font-family:宋体;}
p.ae, li.ae, div.ae
	{mso-style-name:图标;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
p.28, li.28, div.28
	{mso-style-name:图标2;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
p.af, li.af, div.af
	{mso-style-name:习题标题;
	margin-top:6.0pt;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	page-break-after:avoid;
	font-size:14.0pt;
	font-family:黑体;}
p.1c, li.1c, div.1c
	{mso-style-name:部分编号1;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:16.0pt;
	font-family:宋体;}
p.af0, li.af0, div.af0
	{mso-style-name:表标题;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:"Arial","sans-serif";}
p.af1, li.af1, div.af1
	{mso-style-name:"样式 题注 + 居中";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:宋体;}
p.ListTitle, li.ListTitle, div.ListTitle
	{mso-style-name:ListTitle;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:"Arial","sans-serif";}
p.FigureTitle, li.FigureTitle, div.FigureTitle
	{mso-style-name:FigureTitle;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:"Arial","sans-serif";}
p.TableTitle, li.TableTitle, div.TableTitle
	{mso-style-name:TableTitle;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:"Arial","sans-serif";}
p.ProgramTitle, li.ProgramTitle, div.ProgramTitle
	{mso-style-name:ProgramTitle;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	font-size:10.5pt;
	font-family:"Arial","sans-serif";}
p.RightText, li.RightText, div.RightText
	{mso-style-name:RightText;
	margin-top:0cm;
	margin-right:21.0pt;
	margin-bottom:0cm;
	margin-left:42.0pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	border:none;
	padding:0cm;
	font-size:9.0pt;
	font-family:宋体;}
p.af2, li.af2, div.af2
	{mso-style-name:表中文字小五;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:9.0pt;
	font-family:宋体;}
p.af3, li.af3, div.af3
	{mso-style-name:关键词;
	mso-style-link:"关键词 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
span.Char3
	{mso-style-name:"关键词 Char";
	mso-style-link:关键词;
	font-family:宋体;}
p.af4, li.af4, div.af4
	{mso-style-name:文件名;
	mso-style-link:"文件名 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
span.Char4
	{mso-style-name:"文件名 Char";
	mso-style-link:文件名;
	font-family:宋体;}
p.af5, li.af5, div.af5
	{mso-style-name:选项;
	mso-style-link:"选项 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
span.Char5
	{mso-style-name:"选项 Char";
	mso-style-link:选项;
	font-family:宋体;}
p.af6, li.af6, div.af6
	{mso-style-name:命令行;
	mso-style-link:"命令行 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
span.Char6
	{mso-style-name:"命令行 Char";
	mso-style-link:命令行;
	font-family:宋体;}
p.af7, li.af7, div.af7
	{mso-style-name:函数名;
	mso-style-link:"函数名 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
span.Char7
	{mso-style-name:"函数名 Char";
	mso-style-link:函数名;
	font-family:宋体;}
p.af8, li.af8, div.af8
	{mso-style-name:寄存器名;
	mso-style-link:"寄存器名 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
span.Char8
	{mso-style-name:"寄存器名 Char";
	mso-style-link:寄存器名;
	font-family:"Times New Roman","serif";}
p.af9, li.af9, div.af9
	{mso-style-name:变量名;
	mso-style-link:"变量名 Char";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:宋体;}
span.Char9
	{mso-style-name:"变量名 Char";
	mso-style-link:变量名;
	font-family:宋体;}
p.58, li.58, div.58
	{mso-style-name:图中文字小5号左;
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:9.0pt;
	font-family:宋体;}
p.59, li.59, div.59
	{mso-style-name:图中文字小5号靠左;
	margin:0cm;
	margin-bottom:.0001pt;
	layout-grid-mode:char;
	font-size:9.0pt;
	font-family:宋体;}
p.926, li.926, div.926
	{mso-style-name:"样式 代码程序 + 左侧\:  9\.26 厘米";
	margin:0cm;
	margin-bottom:.0001pt;
	layout-grid-mode:char;
	font-size:10.0pt;
	font-family:宋体;}
span.5Char4
	{mso-style-name:"标题 5 Char";
	mso-style-link:"标题 5";
	font-weight:bold;}
span.6Char0
	{mso-style-name:"标题 6 Char";
	mso-style-link:"标题 6";
	font-family:"Arial","sans-serif";
	font-weight:bold;}
span.7Char
	{mso-style-name:"标题 7 Char";
	mso-style-link:"标题 7";
	font-weight:bold;}
span.8Char
	{mso-style-name:"标题 8 Char";
	mso-style-link:"标题 8";
	font-family:"Arial","sans-serif";}
span.9Char
	{mso-style-name:"标题 9 Char";
	mso-style-link:"标题 9";
	font-family:"Arial","sans-serif";}
span.Chara
	{mso-style-name:"脚注文本 Char";
	mso-style-link:脚注文本;
	font-family:宋体;}
span.Charb
	{mso-style-name:"批注文字 Char";
	mso-style-link:批注文字;
	font-family:宋体;}
span.Charc
	{mso-style-name:"页眉 Char";
	mso-style-link:页眉;
	font-family:宋体;}
span.Chard
	{mso-style-name:"页脚 Char";
	mso-style-link:页脚;
	font-family:宋体;}
span.Chare
	{mso-style-name:"日期 Char";
	mso-style-link:日期;
	font-family:宋体;}
span.HTMLChar
	{mso-style-name:"HTML 预设格式 Char\,HTML 预先格式化 Char\,HTML 预先格式化1 Char\,HTML 预先格式化2 Char\,HTML 预先格式化3 Char";
	mso-style-link:"HTML 预设格式\,HTML 预先格式化\,HTML 预先格式化1\,HTML 预先格式化2\,HTML 预先格式化3";
	font-family:宋体;}
span.Charf
	{mso-style-name:"批注主题 Char";
	mso-style-link:批注主题;
	font-family:宋体;
	font-weight:bold;}
span.Charf0
	{mso-style-name:"批注框文本 Char";
	mso-style-link:批注框文本;
	font-family:宋体;}
span.5CharCharChar0
	{mso-style-name:"图中文字5号 Char Char Char";
	font-family:宋体;}
span.5CharCharCharChar
	{mso-style-name:"图中文字小5号 Char Char Char Char";
	font-family:宋体;}
.MsoChpDefault
	{font-size:10.0pt;}
 /* Page Definitions */
 @page WordSection1
	{size:595.3pt 841.9pt;
	margin:72.0pt 2.0cm 72.0pt 2.0cm;
	layout-grid:15.6pt;}
div.WordSection1
	{page:WordSection1;}
 /* List Definitions */
 ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
-->
</style>

</head>

<body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'>

<div class=WordSection1 style='layout-grid:15.6pt'>

<p class=ab><a name="_Toc53320597"><span style='font-family:黑体'>程序</span><span
lang=EN-US>6 &#8209;</span></a><span
lang=EN-US>1</span><span lang=EN-US> linux/boot/bootsect.S</span></p>

<div class=a align=center style='text-align:center'><span lang=EN-US>

<hr size=4 width="100%" align=center>

</span></div>

<p class=a><span lang=EN-US>&nbsp; <u><span style='color:blue'>1</span></u> !</span></p>

<p class=a><span lang=EN-US>&nbsp; <u><span style='color:blue'>2</span></u> !
SYS_SIZE is the number of clicks (16 bytes) to be loaded.</span></p>

<p class=a><span lang=EN-US>&nbsp; <u><span style='color:blue'>3</span></u> !
0x3000 is 0x30000 bytes = 196kB, more than enough for current</span></p>

<p class=a><span lang=EN-US>&nbsp; <u><span style='color:blue'>4</span></u> !
versions of linux</span></p>

<p class=a><span lang=EN-US>&nbsp; &nbsp;&nbsp;! SYS_SIZE</span>是要加载的系统模块长度，单位是节，每节<span
lang=EN-US>16</span>字节。<span lang=EN-US>0x3000</span>共为<span lang=EN-US>0x30000</span>字节<span
lang=EN-US>=196KB</span>。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>若以<span lang=EN-US>1024</span>字节为<span
lang=EN-US>1KB</span>计，则应该是<span lang=EN-US>192KB</span>。对于当前内核版本这个空间长度已足够了。当该值为</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! 0x8000</span>时，表示内核最大为<span
lang=EN-US>512KB</span>。因为内存<span lang=EN-US>0x90000</span>处开始存放移动后的<span
lang=EN-US>bootsect</span>和<span lang=EN-US>setup</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>的代码，因此该值最大不得超过<span
lang=EN-US>0x9000</span>（表示<span lang=EN-US>584KB</span>）。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>这里感叹号<span lang=EN-US>'!'</span>或分号<span
lang=EN-US>';'</span>表示程序注释语句开始。</p>

<p class=a><span lang=EN-US>&nbsp; <u><span style='color:blue'>5</span></u> !</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>头文件<span lang=EN-US>linux/config.h</span>中定义了内核用到的一些常数符号和<span
lang=EN-US>Linus</span>自己使用的默认硬盘参数块。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>例如其中定义了以下一些常数：</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! DEF_SYSSIZE&nbsp; = 0x3000 - </span>默认系统模块长度。单位是节，每节为<span
lang=EN-US>16</span>字节；</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! DEF_INITSEG&nbsp; = 0x9000 - </span>默认本程序代码移动目的段位置；</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! DEF_SETUPSEG = 0x9020 - </span>默认<span
lang=EN-US>setup</span>程序代码段位置；</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! DEF_SYSSEG&nbsp;&nbsp; =
0x1000 - </span>默认从磁盘加载系统模块到内存的段位置。</p>

<p class=a><span lang=EN-US>&nbsp; <u><span style='color:blue'>6</span></u>
#include &lt;linux/config.h&gt;</span></p>

<p class=a><span lang=EN-US>&nbsp; <u><span style='color:blue'>7</span></u>
SYSSIZE = DEF_SYSSIZE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>定义一个标号或符号。指明编译连接后<span lang=EN-US>system</span>模块的大小。</p>

<p class=a><span lang=EN-US>&nbsp; <u><span style='color:blue'>8</span></u> !</span></p>

<p class=a><span lang=EN-US>&nbsp; <u><span style='color:blue'>9</span></u>
!&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bootsect.s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(C) 1991 Linus Torvalds</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>10</span></u>
!&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; modified by Drew Eckhardt</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>11</span></u> !</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>12</span></u> !
bootsect.s is loaded at 0x7c00 by the bios-startup routines, and moves</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>13</span></u> !
iself out of the way to address 0x90000, and jumps there.</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>14</span></u> !</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>15</span></u> !
It then loads 'setup' directly after itself (0x90200), and the system</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>16</span></u> !
at 0x10000, using BIOS interrupts. </span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>17</span></u> !</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>18</span></u> !
NOTE! currently system is at most 8*65536 bytes long. This should be no</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>19</span></u> !
problem, even in the future. I want to keep it simple. This 512 kB</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>20</span></u> !
kernel size should be enough, especially as this doesn't contain the</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>21</span></u> !
buffer cache as in minix</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>22</span></u> !</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>23</span></u> !
The loader has been made as simple as possible, and continuos</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>24</span></u> !
read errors will result in a unbreakable loop. Reboot by hand. It</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>25</span></u> !
loads pretty fast by getting whole sectors at a time whenever possible.</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>以下是前面文字的译文：</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; !&nbsp;&nbsp;&nbsp;&nbsp;
bootsect.s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(C) 1991 Linus Torvalds </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; !&nbsp;&nbsp;&nbsp;&nbsp; Drew
Eckhardt</span>修改</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! bootsect.s </span>被<span
lang=EN-US>ROM BIOS</span>启动子程序加载至<span lang=EN-US>0x7c00 (31KB)</span>处，并将自己移到了地址<span
lang=EN-US>0x90000</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! (576KB)</span>处，并跳转至那里。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>它然后使用<span lang=EN-US>BIOS</span>中断将<span
lang=EN-US>'setup'</span>直接加载到自己的后面<span lang=EN-US>(0x90200)(576.5KB)</span>，并将<span
lang=EN-US>system</span>加</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>载到地址<span lang=EN-US>0x10000</span>处。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>注意<span lang=EN-US>! </span>目前的内核系统最大长度限制为<span
lang=EN-US>(8*65536)(512KB)</span>字节，即使是在将来这也应该没有问</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>题的。我想让它保持简单明了。这样<span
lang=EN-US>512KB</span>的最大内核长度应该足够了，尤其是这里没有象</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! MINIX</span>中一样包含缓冲区高速缓冲。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>加载程序已经做得够简单了，所以持续地读操作出错将导致死循环。只能手工重启。只要可能，</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>通过一次读取所有的扇区，加载过程可以做得很快。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>26</span></u> </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>伪指令（伪操作符）<span
lang=EN-US>.globl</span>或<span lang=EN-US>.global</span>用于定义随后的标识符是外部的或全局的，并且即使不</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>使用也强制引入。 <span
lang=EN-US>.text</span>、<span lang=EN-US>.data</span>和<span lang=EN-US>.bss</span>用于分别定义当前代码段、数据段和未初始化数据段。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>在链接多个目标模块时，链接程序（<span
lang=EN-US>ld86</span>）会根据它们的类别把各个目标模块中的相应段分别</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>组合（合并）在一起。这里把三个段都定义在同一重叠地址范围中，因此本程序实际上不分段。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>另外，后面带冒号的字符串是标号，例如下面的<span
lang=EN-US>'begtext:'</span>。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>一条汇编语句通常由标号（可选）、指令助记符（指令名）和操作数三个字段组成。标号位于</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>一条指令的第一个字段。它代表其所在位置的地址，通常指明一个跳转指令的目标位置。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>27</span></u>
.globl begtext, begdata, begbss, endtext, enddata, endbss</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>28</span></u>
.text&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
</span>文本段（代码段）。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>29</span></u>
begtext:</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>30</span></u>
.data&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>数据段。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>31</span></u>
begdata:</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>32</span></u>
.bss&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>未初始化数据段。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>33</span></u>
begbss:</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>34</span></u>
.text&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;! </span>文本段（代码段）。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>35</span></u> </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>下面等号<span lang=EN-US>'='</span>或符号<span
lang=EN-US>'EQU'</span>用于定义标识符或标号所代表的值。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>36</span></u>
SETUPLEN =
4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! nr of setup-sectors</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! setup</span>程序代码占用磁盘扇区数<span lang=EN-US>(setup-sectors)</span>值；</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>37</span></u>
BOOTSEG&nbsp; = 0x07c0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! original address of boot-sector</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! bootsect</span>代码所在内存原始段地址；</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>38</span></u>
INITSEG&nbsp; =
DEF_INITSEG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! we move boot here - out of the way</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>将<span lang=EN-US>bootsect</span>移到位置<span lang=EN-US>0x90000 - </span>避开系统模块占用处；</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>39</span></u>
SETUPSEG =
DEF_SETUPSEG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! setup starts here</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! setup</span>程序从内存<span lang=EN-US>0x90200</span>处开始；</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>40</span></u>
SYSSEG&nbsp;&nbsp; =
DEF_SYSSEG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! system loaded at 0x10000 (65536).</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! system</span>模块加载到<span lang=EN-US>0x10000</span>（<span lang=EN-US>64 KB</span>）处；</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>41</span></u>
ENDSEG&nbsp;&nbsp; = SYSSEG + SYSSIZE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! where to stop loading</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>停止加载的段地址；</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>42</span></u> </span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>43</span></u> !
ROOT_DEV &amp; SWAP_DEV are now written by &quot;build&quot;.</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>根文件系统设备号<span
lang=EN-US>ROOT_DEV</span>和交换设备号<span lang=EN-US>SWAP_DEV </span>现在由<span
lang=EN-US>tools</span>目录下的<span lang=EN-US>build</span>程序写入。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>设备号<span lang=EN-US>0x306</span>指定根文件系统设备是第<span
lang=EN-US>2</span>个硬盘的第<span lang=EN-US>1</span>个分区。当年<span lang=EN-US>Linus</span>是在第<span
lang=EN-US>2</span>个硬盘上</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>安装了<span lang=EN-US>Linux
0.11</span>系统，所以这里<span lang=EN-US>ROOT_DEV</span>被设置为<span lang=EN-US>0x306</span>。在编译这个内核时你可以根据</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>自己根文件系统所在设备位置修改这个设备号。这个设备号是<span
lang=EN-US>Linux</span>系统老式的硬盘设备号命</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>名方式，硬盘设备号具体值的含义如下：</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>设备号<span lang=EN-US>=</span>主设备号<span
lang=EN-US>*256 + </span>次设备号（也即<span lang=EN-US>dev_no = (major&lt;&lt;8) +
minor </span>）</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>（主设备号：<span lang=EN-US>1-</span>内存<span
lang=EN-US>,2-</span>磁盘<span lang=EN-US>,3-</span>硬盘<span lang=EN-US>,4-ttyx,5-tty,6-</span>并行口<span
lang=EN-US>,7-</span>非命名管道）</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! 0x300 - /dev/hd0 - </span>代表整个第<span
lang=EN-US>1</span>个硬盘；</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! 0x301 - /dev/hd1 - </span>第<span
lang=EN-US>1</span>个盘的第<span lang=EN-US>1</span>个分区；</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; !&nbsp; …</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! 0x304 - /dev/hd4 - </span>第<span
lang=EN-US>1</span>个盘的第<span lang=EN-US>4</span>个分区；</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! 0x305 - /dev/hd5 - </span>代表整个第<span
lang=EN-US>2</span>个硬盘；</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! 0x306 - /dev/hd6 - </span>第<span
lang=EN-US>2</span>个盘的第<span lang=EN-US>1</span>个分区；</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; !&nbsp; …</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! 0x309 - /dev/hd9 - </span>第<span
lang=EN-US>2</span>个盘的第<span lang=EN-US>4</span>个分区；</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>从<span lang=EN-US>Linux</span>内核<span
lang=EN-US>0.95</span>版后就已经使用与现在内核相同的命名方法了。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>44</span></u> ROOT_DEV
= 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>根文件系统设备使用与系统引导时同样的设备；</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>45</span></u>
SWAP_DEV = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>交换设备使用与系统引导时同样的设备；</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>46</span></u> </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>伪指令<span lang=EN-US>entry</span>迫使链接程序在生成的执行程序（<span
lang=EN-US>a.out</span>）中包含指定的标识符或标号。这里是</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>程序执行开始点。<span
lang=EN-US>49 -- 58</span>行作用是将自身<span lang=EN-US>(bootsect)</span>从目前段位置<span
lang=EN-US> 0x07c0(31KB) </span>移动到</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! 0x9000(576KB) </span>处，共<span
lang=EN-US>256</span>字（<span lang=EN-US>512</span>字节），然后跳转到移动后代码的<span
lang=EN-US>go</span>标号处，也即本程</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>序的下一语句处。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>47</span></u>
entry start&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
</span>告知链接程序，程序从<span lang=EN-US>start</span>标号开始执行。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>48</span></u>
start:</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>49</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; ax,#BOOTSEG&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
</span>将<span lang=EN-US>ds</span>段寄存器置为<span lang=EN-US>0x7C0</span>；</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>50</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; ds,ax</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>51</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; ax,#INITSEG &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
</span>将<span lang=EN-US>es</span>段寄存器置为<span lang=EN-US>0x9000</span>；</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>52</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; es,ax</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>53</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; cx,#256&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>设置移动计数值<span lang=EN-US>=256</span>字（<span lang=EN-US>512</span>字节）；</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>54</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sub&nbsp;&nbsp;&nbsp;&nbsp; si,si&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>源地址<span lang=EN-US>&nbsp;&nbsp; ds:si = 0x07C0:0x0000</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>55</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sub&nbsp;&nbsp;&nbsp;&nbsp; di,di&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>目的地址<span lang=EN-US> es:di = 0x9000:0x0000</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>56</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
rep&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
</span>重复执行并递减<span lang=EN-US>cx</span>的值，直到<span lang=EN-US>cx = 0</span>为止。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>57</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
movw&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>即<span lang=EN-US>movs</span>指令。从内存<span lang=EN-US>[si]</span>处移动<span
lang=EN-US>cx</span>个字到<span lang=EN-US>[di]</span>处。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>58</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
jmpi&nbsp;&nbsp;&nbsp; go,INITSEG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>段间跳转（<span lang=EN-US>Jump Intersegment</span>）。这里<span lang=EN-US>INITSEG</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! </span>指出跳转到的段地址，标号<span lang=EN-US>go</span>是段内偏移地址。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>59</span></u> </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>从下面开始，<span lang=EN-US>CPU</span>在已移动到<span
lang=EN-US>0x90000</span>位置处的代码中执行。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>这段代码设置几个段寄存器，包括栈寄存器<span
lang=EN-US>ss</span>和<span lang=EN-US>sp</span>。栈指针<span lang=EN-US>sp</span>只要指向远大于<span
lang=EN-US>512</span>字节偏移</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>（即地址<span lang=EN-US>0x90200</span>）处都可以。因为从<span
lang=EN-US>0x90200</span>地址开始处还要放置<span lang=EN-US>setup</span>程序，而此时<span
lang=EN-US>setup</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>程序大约为<span lang=EN-US>4</span>个扇区，因此<span
lang=EN-US>sp</span>要指向大于（<span lang=EN-US>0x200 + 0x200 * 4 +</span>堆栈大小）位置处。这里<span
lang=EN-US>sp</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>设置为 <span lang=EN-US>0x9ff00
- 12</span>（参数表长度），即<span lang=EN-US>sp = 0xfef4</span>。在此之上位置会存放一个自建的驱动</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>器参数表，见下面说明。实际上<span
lang=EN-US>BIOS</span>把引导扇区加载到<span lang=EN-US>0x7c00 </span>处并把执行权交给引导程序时，</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! ss = 0x00</span>，<span
lang=EN-US>sp = 0xfffe</span>。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>另外，第<span lang=EN-US>65</span>行上<span
lang=EN-US>push</span>指令的期望作用是想暂时把段值保留在栈中，然后等下面执行完判断磁道</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>扇区数后再弹出栈，并给段寄存器 <span
lang=EN-US>fs</span>和<span lang=EN-US>gs</span>赋值（第<span lang=EN-US>109</span>行）。但是由于第<span
lang=EN-US>67</span>、<span lang=EN-US>68</span>两语句修改</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>了栈段的位置，因此除非在执行栈弹出操作之前把栈段恢复到原位置，否则这样设计就是错误的。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>因此这里存在一个<span
lang=EN-US>bug</span>。改正的方法之一是去掉第<span lang=EN-US>65</span>行，并把第<span
lang=EN-US>109</span>行修改成“<span lang=EN-US>mov ax,cs</span>”。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>60</span></u>
go:&nbsp;&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp;&nbsp;&nbsp;
ax,cs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;!
</span>将<span lang=EN-US>ds</span>、<span lang=EN-US>es</span>和<span lang=EN-US>ss</span>都置成移动后代码所在的段处<span
lang=EN-US>(0x9000)</span>。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>61</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; dx,#0xfef4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;!
arbitrary value &gt;&gt;512 - disk parm size</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>62</span></u> </span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>63</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; ds,ax</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>64</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; es,ax</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>65</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
push&nbsp;&nbsp;&nbsp; ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>临时保存段值（<span lang=EN-US>0x9000</span>），供<span lang=EN-US>109</span>行使用。（滑头<span
lang=EN-US>!</span>）</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>66</span></u> </span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>67</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp;
ss,ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;!
put stack at 0x9ff00 - 12.</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>68</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; sp,dx</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>69</span></u> /*</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>70</span></u>&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Many BIOS's default disk parameter tables will
not </span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>71</span></u>&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; recognize multi-sector reads beyond the maximum
sector number</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>72</span></u>&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; specified in the default diskette parameter
tables - this may</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>73</span></u>&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mean 7 sectors in some cases.</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>74</span></u>&nbsp;
*</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>75</span></u>&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Since single sector reads are slow and out of
the question,</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>76</span></u>&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; we must take care of this by creating new
parameter tables</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>77</span></u>&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (for the first disk) in RAM.&nbsp; We will set
the maximum sector</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>78</span></u>&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count to 18 - the most we will encounter on an
HD 1.44.&nbsp; </span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>79</span></u>&nbsp;
*</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>80</span></u>&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; High doesn't hurt.&nbsp; Low does.</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>81</span></u>&nbsp;
*</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>82</span></u>&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Segments are as follows: ds=es=ss=cs - INITSEG,</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>83</span></u>&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
fs = 0, gs = parameter table segment</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>84</span></u>&nbsp;
*/</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; /*</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>对于多扇区读操作所读的扇区数超过默认磁盘参数表中指定的最大扇区数时，</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>很多<span lang=EN-US>BIOS</span>将不能进行正确识别。在某些情况下是<span lang=EN-US>7</span>个扇区。</p>

<p class=a><span lang=EN-US>&nbsp; &nbsp;&nbsp;&nbsp;*</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>由于单扇区读操作太慢，不予以考虑，因此我们必须通过在内存中重创建新的</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>参数表（为第<span lang=EN-US>1</span>个驱动器）来解决这个问题。我们将把其中最大扇区数设置为</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18 -- </span>即在<span lang=EN-US>1.44MB</span>磁盘上会碰到的最大数值。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>这个数值大了不会出问题，但是太小就不行了。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp; *</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>段寄存器将被设置成：<span lang=EN-US>ds=es=ss=cs -
</span>都为<span lang=EN-US>INITSEG</span>（<span lang=EN-US>0x9000</span>），</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fs = 0</span>，<span lang=EN-US>gs = </span>参数表所在段值。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp; */</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>85</span></u> ! BIOS</span>设置的中断<span
lang=EN-US>0x1E</span>的中断向量值是软驱参数表地址。该向量值位于内存<span lang=EN-US>0x1E * 4 = 0x78</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>处。这段代码首先从内存<span
lang=EN-US>0x0000:0x0078</span>处复制原软驱参数表到<span lang=EN-US>0x9000:0xfef4</span>处，然后修改</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>表中的每磁道最大扇区数为<span
lang=EN-US>18</span>。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>86</span></u> </span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>87</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
push&nbsp;&nbsp;&nbsp; #0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>置段寄存器<span lang=EN-US>fs = 0</span>。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>88</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pop &nbsp;&nbsp;&nbsp;&nbsp;fs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! fs:bx</span>指向存有软驱参数表地址处（指针的指针）。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>89</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp;
bx,#0x78&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! fs:bx is
parameter table address</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>下面指令表示下一条语句的操作数在<span
lang=EN-US>fs</span>段寄存器所指的段中。它只影响其下一条语句。这里</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>把 <span lang=EN-US>fs:bx
</span>所指内存位置处的表地址放到寄存器对 <span lang=EN-US>gs:si </span>中作为原地址。寄存器对 <span
lang=EN-US>es:di =</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! 0x9000:0xfef4 </span>为目的地址。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>90</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
seg fs</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>91</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lgs&nbsp;&nbsp;&nbsp;&nbsp;
si,(bx)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !
gs:si is source</span></p>

<p class=a><span lang=EN-US>&nbsp;<a name=L92><u><span style='color:blue'>92</span></u></a>
</span></p>

<p class=a><span lang=EN-US>&nbsp;<a name=L93><u><span style='color:blue'>93</span></u></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp;
di,dx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! es:di is destination ! dx=0xfef4</span>，在<span lang=EN-US>61</span>行被设置。</p>

<p class=a><span lang=EN-US>&nbsp;<a name=L94><u><span style='color:blue'>94</span></u></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp;
cx,#6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! copy 12 bytes</span></p>

<p class=a><span lang=EN-US>&nbsp;<a name=L95><u><span style='color:blue'>95</span></u></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
cld&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! </span>清方向标志。复制时指针递增。</p>

<p class=a><span lang=EN-US>&nbsp;<a name=L96><u><span style='color:blue'>96</span></u></a>
</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>97</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
rep&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>复制<span lang=EN-US>12</span>字节的软驱参数表到<span lang=EN-US>0x9000:0xfef4</span>处。</p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>98</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
seg gs</span></p>

<p class=a><span lang=EN-US>&nbsp;<u><span style='color:blue'>99</span></u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
movw</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>100</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>101</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; di,dx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! es:di</span>指向新表，修改表中偏移<span lang=EN-US>4</span>处的最大扇区数为<span lang=EN-US>18</span>。</p>

<p class=a><u><span lang=EN-US style='color:blue'>102</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
movb&nbsp;&nbsp;&nbsp;
4(di),*18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! patch sector
count</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>103</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>104</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; seg fs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>让中断向量<span lang=EN-US>0x1E</span>的值指向新表。</p>

<p class=a><u><span lang=EN-US style='color:blue'>105</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; (bx),di</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>106</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; seg fs</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>107</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; 2(bx),es</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>108</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>109</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pop&nbsp;&nbsp;&nbsp;&nbsp; ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>此时<span lang=EN-US>ax</span>中是上面第<span lang=EN-US>65</span>行保留下来的段值（<span
lang=EN-US>0x9000</span>）。</p>

<p class=a><u><span lang=EN-US style='color:blue'>110</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; fs,ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>设置<span lang=EN-US>fs = gs = 0x9000</span>。</p>

<p class=a><u><span lang=EN-US style='color:blue'>111</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; gs,ax</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>112</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>113</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xor&nbsp;&nbsp;&nbsp;&nbsp;
ah,ah&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! reset FDC ! </span>复位软盘控制器，让其采用新参数。</p>

<p class=a><u><span lang=EN-US style='color:blue'>114</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xor&nbsp;&nbsp;&nbsp;&nbsp; dl,dl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! dl = 0</span>，第<span lang=EN-US>1</span>个软驱。</p>

<p class=a><u><span lang=EN-US style='color:blue'>115</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int&nbsp;&nbsp;&nbsp;&nbsp; 0x13&nbsp;&nbsp;&nbsp; </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>116</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>117</span></u><span
lang=EN-US> ! load the setup-sectors directly after the bootblock.</span></p>

<p class=a><a name=L118><u><span lang=EN-US style='color:blue'>118</span></u></a><span
lang=EN-US> ! Note that 'es' is already set up.</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>在<span lang=EN-US>bootsect</span>程序块后紧根着加载<span
lang=EN-US>setup</span>模块的代码数据。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>注意<span lang=EN-US>es</span>已经设置好了。（在移动代码时<span
lang=EN-US>es</span>已经指向目的段地址处<span lang=EN-US>0x9000</span>）。</p>

<p class=a><a name=L119><u><span lang=EN-US style='color:blue'>119</span></u></a><span
lang=EN-US> </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! 121--137</span>行的用途是利用<span
lang=EN-US>ROM BIOS</span>中断<span lang=EN-US>INT 0x13 </span>将<span lang=EN-US>setup
</span>模块从磁盘第<span lang=EN-US>2</span>个扇区开始读到</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! 0x90200 </span>开始处，共读<span
lang=EN-US> 4</span>个扇区。在读操作过程中如果读出错，则显示磁盘上出错扇区位置，</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>然后复位驱动器并重试，没有退路。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! INT 0x13</span>读扇区使用调用参数设置如下：</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! ah = 0x02 - </span>读磁盘扇区到内存；<span
lang=EN-US>al = </span>需要读出的扇区数量；</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! ch = </span>磁道<span
lang=EN-US>(</span>柱面<span lang=EN-US>)</span>号的低<span lang=EN-US>8</span>位；<span
lang=EN-US>&nbsp;&nbsp; cl = </span>开始扇区<span lang=EN-US>(</span>位<span
lang=EN-US>0-5)</span>，磁道号高<span lang=EN-US>2</span>位<span lang=EN-US>(</span>位<span
lang=EN-US>6-7)</span>；</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! dh = </span>磁头号；<span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
dl = </span>驱动器号（如果是硬盘则位<span lang=EN-US>7</span>要置位）；</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! es:bx </span><span lang=EN-US
style='font-family:Wingdings'>à</span>指向数据缓冲区； &nbsp;如果出错则<span lang=EN-US>CF</span>标志置位，<span
lang=EN-US>ah</span>中是出错码。</p>

<p class=a><a name=L120><u><span lang=EN-US style='color:blue'>120</span></u></a><span
lang=EN-US> load_setup:</span></p>

<p class=a><a name=L121><u><span lang=EN-US style='color:blue'>121</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xor&nbsp;&nbsp;&nbsp;&nbsp; dx,
dx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! drive 0, head 0</span></p>

<p class=a><a name=L122><u><span lang=EN-US style='color:blue'>122</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp;
cx,#0x0002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! sector 2, track 0</span></p>

<p class=a><a name=L123><u><span lang=EN-US style='color:blue'>123</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp;
bx,#0x0200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! address = 512, in INITSEG</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>124</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; ax,#0x0200+SETUPLEN&nbsp;&nbsp;&nbsp;&nbsp; !
service 2, nr of sectors</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>125</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int&nbsp;&nbsp;&nbsp;&nbsp;
0x13&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! read it</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>126</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
jnc&nbsp;&nbsp;&nbsp;&nbsp;
ok_load_setup&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! ok
- continue</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>127</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>128</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
push&nbsp;&nbsp;&nbsp;
ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! dump error code ! </span>显示出错信息。出错码入栈。</p>

<p class=a><u><span lang=EN-US style='color:blue'>129</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
call&nbsp;&nbsp;&nbsp; print_nl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>屏幕光标回车。</p>

<p class=a><u><span lang=EN-US style='color:blue'>130</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; bp, sp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! ss:bp</span>指向欲显示的字（<span lang=EN-US>word</span>）。</p>

<p class=a><u><span lang=EN-US style='color:blue'>131</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
call&nbsp;&nbsp;&nbsp; print_hex&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>显示十六进制值。</p>

<p class=a><u><span lang=EN-US style='color:blue'>132</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pop&nbsp;&nbsp;&nbsp;&nbsp; ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>133</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>134</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xor&nbsp;&nbsp;&nbsp;&nbsp; dl, dl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! reset FDC ! </span>复位磁盘控制器，重试。</p>

<p class=a><u><span lang=EN-US style='color:blue'>135</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xor&nbsp;&nbsp;&nbsp;&nbsp; ah, ah</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>136</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int&nbsp;&nbsp;&nbsp;&nbsp; 0x13</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>137</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
j&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; load_setup&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! j </span>即<span lang=EN-US>jmp</span>指令。</p>

<p class=a><u><span lang=EN-US style='color:blue'>138</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>139</span></u><span
lang=EN-US> ok_load_setup:</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>140</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>141</span></u><span
lang=EN-US> ! Get disk drive parameters, specifically nr of sectors/track</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>这段代码取磁盘驱动器的参数，实际上是取每磁道扇区数，并保存在位置<span
lang=EN-US>sectors</span>处。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>取磁盘驱动器参数<span
lang=EN-US>INT 0x13</span>调用格式和返回信息如下：</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! ah = 0x08&nbsp;&nbsp;&nbsp;&nbsp; dl = </span>驱动器号（如果是硬盘则要置位<span
lang=EN-US>7</span>为<span lang=EN-US>1</span>）。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>返回信息：</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>如果出错则<span lang=EN-US>CF</span>置位，并且<span
lang=EN-US>ah = </span>状态码。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! ah = 0</span>，<span
lang=EN-US> al = 0</span>，<span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
bl = </span>驱动器类型（<span lang=EN-US>AT/PS2</span>）</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! ch = </span>最大磁道号的低<span
lang=EN-US>8</span>位，<span lang=EN-US>&nbsp; cl = </span>每磁道最大扇区数<span
lang=EN-US>(</span>位<span lang=EN-US>0-5)</span>，最大磁道号高<span lang=EN-US>2</span>位<span
lang=EN-US>(</span>位<span lang=EN-US>6-7)</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! dh = </span>最大磁头数，<span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dl = </span>驱动器数量，</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! es:di -</span><span
lang=EN-US style='font-family:Wingdings'>à</span><span lang=EN-US> </span>软驱磁盘参数表。</p>

<p class=a><u><span lang=EN-US style='color:blue'>142</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>143</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xor&nbsp;&nbsp;&nbsp;&nbsp; dl,dl</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>144</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp;
ah,#0x08&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! AH=8 is
get drive parameters</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>145</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int&nbsp;&nbsp;&nbsp;&nbsp; 0x13</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>146</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xor&nbsp;&nbsp;&nbsp;&nbsp; ch,ch</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>下面指令表示下一条语句的操作数在 <span
lang=EN-US>cs</span>段寄存器所指的段中。它只影响其下一条语句。实际</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>上，由于本程序代码和数据都被设置处于同一个段中，即段寄存器<span
lang=EN-US>cs</span>和<span lang=EN-US>ds</span>、<span lang=EN-US>es</span>的值相同，因</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>此本程序中此处可以不使用该指令。</p>

<p class=a><u><span lang=EN-US style='color:blue'>147</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; seg cs</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>下句保存每磁道扇区数。对于软盘来说（<span
lang=EN-US>dl=0</span>），其最大磁道号不会超过<span lang=EN-US>256</span>，<span lang=EN-US>ch</span>已经足够表</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>示它，因此<span lang=EN-US>cl</span>的位<span
lang=EN-US>6-7</span>肯定为<span lang=EN-US>0</span>。又<span lang=EN-US>146</span>行已置<span
lang=EN-US>ch=0</span>，因此此时<span lang=EN-US>cx</span>中是每磁道扇区数。</p>

<p class=a><u><span lang=EN-US style='color:blue'>148</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; sectors,cx</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>149</span></u><span
lang=EN-US> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mov&nbsp;&nbsp;&nbsp;&nbsp;
ax,#INITSEG</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>150</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; es,ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>因为上面取磁盘参数中断改了<span lang=EN-US>es</span>值，这里重新改回。</p>

<p class=a><u><span lang=EN-US style='color:blue'>151</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>152</span></u><span
lang=EN-US> ! Print some inane message</span></p>

<p class=a><span lang=EN-US>&nbsp; &nbsp;&nbsp;! </span>显示信息：“<span lang=EN-US>'Loading'+</span>回车<span
lang=EN-US>+</span>换行”，共显示包括回车和换行控制字符在内的<span lang=EN-US>9</span>个字符。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! BIOS</span>中断<span lang=EN-US>0x10</span>功能号<span
lang=EN-US> ah = 0x03</span>，读光标位置。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>输入：<span lang=EN-US>bh
= </span>页号</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>返回：<span lang=EN-US>ch
= </span>扫描开始线；<span lang=EN-US>cl = </span>扫描结束线；<span lang=EN-US>dh = </span>行号<span
lang=EN-US>(0x00</span>顶端<span lang=EN-US>)</span>；<span lang=EN-US>dl = </span>列号<span
lang=EN-US>(0x00</span>最左边<span lang=EN-US>)</span>。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! BIOS</span>中断<span lang=EN-US>0x10</span>功能号<span
lang=EN-US> ah = 0x13</span>，显示字符串。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>输入：<span lang=EN-US>al
= </span>放置光标的方式及规定属性。<span lang=EN-US>0x01-</span>表示使用<span lang=EN-US>bl</span>中的属性值，光标停在字符串结尾处。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! es:bp </span>此寄存器对指向要显示的字符串起始位置处。<span
lang=EN-US>cx = </span>显示的字符串字符数。<span lang=EN-US>bh = </span>显示页面号；</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! bl = </span>字符属性。<span
lang=EN-US>dh = </span>行号；<span lang=EN-US>dl = </span>列号。</p>

<p class=a><u><span lang=EN-US style='color:blue'>153</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>154</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp;
ah,#0x03&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! read
cursor pos</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>155</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xor&nbsp;&nbsp;&nbsp;&nbsp; bh,bh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>首先读光标位置。返回光标位置值在<span lang=EN-US>dx</span>中。</p>

<p class=a><u><span lang=EN-US style='color:blue'>156</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int&nbsp;&nbsp;&nbsp;&nbsp; 0x10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! dh - </span>行（<span lang=EN-US>0--24</span>）；<span lang=EN-US>dl - </span>列<span
lang=EN-US>(0--79)</span>。</p>

<p class=a><u><span lang=EN-US style='color:blue'>157</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>158</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; cx,#9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>共显示<span lang=EN-US>9</span>个字符。</p>

<p class=a><u><span lang=EN-US style='color:blue'>159</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp;
bx,#0x0007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! page 0, attribute
7 (normal)</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>160</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; bp,#msg1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! es:bp</span>指向要显示的字符串。</p>

<p class=a><u><span lang=EN-US style='color:blue'>161</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp;
ax,#0x1301&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! write string, move
cursor</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>162</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int&nbsp;&nbsp;&nbsp;&nbsp; 0x10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>写字符串并移动光标到串结尾处。</p>

<p class=a><u><span lang=EN-US style='color:blue'>163</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>164</span></u><span
lang=EN-US> ! ok, we've written the message, now</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>165</span></u><span
lang=EN-US> ! we want to load the system (at 0x10000)</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>现在开始将<span lang=EN-US>system</span>模块加载到<span
lang=EN-US>0x10000</span>（<span lang=EN-US>64KB</span>）开始处。</p>

<p class=a><u><span lang=EN-US style='color:blue'>166</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>167</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; ax,#SYSSEG</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>168</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp;
es,ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;!
segment of 0x010000 ! es = </span>存放<span lang=EN-US>system</span>的段地址。</p>

<p class=a><u><span lang=EN-US style='color:blue'>169</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; call&nbsp;&nbsp;&nbsp;
read_it&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;! </span>读磁盘上<span
lang=EN-US>system</span>模块，<span lang=EN-US>es</span>为输入参数。</p>

<p class=a><u><span lang=EN-US style='color:blue'>170</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
call&nbsp;&nbsp;&nbsp; kill_motor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;!
</span>关闭驱动器马达，这样就可以知道驱动器的状态了。</p>

<p class=a><u><span lang=EN-US style='color:blue'>171</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
call&nbsp;&nbsp;&nbsp; print_nl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>光标回车换行。</p>

<p class=a><u><span lang=EN-US style='color:blue'>172</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>173</span></u><span
lang=EN-US> ! After that we check which root-device to use. If the device is</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>174</span></u><span
lang=EN-US> ! defined (!= 0), nothing is done and the given device is used.</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>175</span></u><span
lang=EN-US> ! Otherwise, either /dev/PS0 (2,28) or /dev/at0 (2,8), depending</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>176</span></u><span
lang=EN-US> ! on the number of sectors that the BIOS reports currently.</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>此后，我们检查要使用哪个根文件系统设备（简称根设备）。如果已经指定了设备<span
lang=EN-US>(!=0)</span>，</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>就直接使用给定的设备。否则就需要根据<span
lang=EN-US>BIOS</span>报告的每磁道扇区数来确定到底使用<span lang=EN-US>/dev/PS0</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! (2,28)</span>，还是<span
lang=EN-US> /dev/at0 (2,8)</span>。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; !! </span>上面一行中两个设备文件的含义：</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; !! </span>在<span lang=EN-US>Linux</span>中软驱的主设备号是<span
lang=EN-US>2(</span>参见第<span lang=EN-US>43</span>行的注释<span lang=EN-US>)</span>，次设备号<span
lang=EN-US> = type*4 + nr</span>，其中</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; !! nr</span>为<span lang=EN-US>0-3</span>分别对应软驱<span
lang=EN-US>A</span>、<span lang=EN-US>B</span>、<span lang=EN-US>C</span>或<span
lang=EN-US>D</span>；<span lang=EN-US>type</span>是软驱的类型（<span lang=EN-US>2</span><span
lang=EN-US style='font-family:Wingdings'>à</span><span lang=EN-US>1.2MB</span>或<span
lang=EN-US>7</span><span lang=EN-US style='font-family:Wingdings'>à</span><span
lang=EN-US>1.44MB</span>等）。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; !! </span>因为<span lang=EN-US>7*4
+ 0 = 28</span>，所以<span lang=EN-US> /dev/PS0 (2,28)</span>指的是<span lang=EN-US>1.44MB
A</span>驱动器<span lang=EN-US>,</span>其设备号是<span lang=EN-US>0x021c </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; !! </span>同理<span lang=EN-US>
/dev/at0 (2,8)</span>指的是<span lang=EN-US>1.2MB A</span>驱动器，其设备号是<span
lang=EN-US>0x0208</span>。</p>

<p class=a><span lang=EN-US>&nbsp;</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>下面<span lang=EN-US>root_dev</span>定义在引导扇区<span
lang=EN-US>508</span>，<span lang=EN-US>509</span>字节处，指根文件系统所在设备号。<span
lang=EN-US>0x0306</span>指第<span lang=EN-US>2</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>个硬盘第<span lang=EN-US>1</span>个分区。这里默认为<span
lang=EN-US>0x0306</span>是因为当时<span lang=EN-US> Linus </span>开发<span lang=EN-US>Linux</span>系统时是在第<span
lang=EN-US>2</span>个硬</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>盘第<span lang=EN-US>1</span>个分区中存放根文件系统。这个值需要根据你自己根文件系统所在硬盘和分区进行修</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>改。例如，如果你的根文件系统在第<span
lang=EN-US>1</span>个硬盘的第<span lang=EN-US>1</span>个分区上，那么该值应该为<span lang=EN-US>0x0301</span>，即</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>（<span lang=EN-US>0x01,
0x03</span>）。如果根文件系统是在第<span lang=EN-US>2</span>个<span lang=EN-US>Bochs</span>软盘上，那么该值应该为<span
lang=EN-US>0x021D</span>，即</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>（<span lang=EN-US>0x1D,0x02</span>）。当编译内核时，你可以在<span
lang=EN-US>Makefile</span>文件中另行指定你自己的值，内核映像</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>文件<span lang=EN-US>Image</span>的创建程序<span
lang=EN-US>tools/build</span>会使用你指定的值来设置你的根文件系统所在设备号。</p>

<p class=a><u><span lang=EN-US style='color:blue'>177</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>178</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; seg cs</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>179</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; ax,root_dev&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>取<span lang=EN-US>508,509</span>字节处的根设备号并判断是否已被定义。</p>

<p class=a><u><span lang=EN-US style='color:blue'>180</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
or&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ax,ax</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>181</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
jne&nbsp;&nbsp;&nbsp;&nbsp; root_defined</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>取上面第<span lang=EN-US>148</span>行保存的每磁道扇区数。如果<span
lang=EN-US>sectors=15</span>则说明是<span lang=EN-US>1.2MB</span>的驱动器；如果</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! sectors=18</span>，则说明是<span
lang=EN-US>1.44MB</span>软驱。因为是可引导的驱动器，所以肯定是<span lang=EN-US>A</span>驱。</p>

<p class=a><u><span lang=EN-US style='color:blue'>182</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; seg cs</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>183</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; bx,sectors</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>184</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mov&nbsp;&nbsp;&nbsp;&nbsp;
ax,#0x0208&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! /dev/ps0 - 1.2Mb</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>185</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
cmp&nbsp;&nbsp;&nbsp;&nbsp; bx,#15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>判断每磁道扇区数是否<span lang=EN-US>=15</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>186</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
je&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root_defined&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>如果等于，则<span lang=EN-US>ax</span>中就是引导驱动器的设备号。</p>

<p class=a><u><span lang=EN-US style='color:blue'>187</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; ax,#0x021c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! /dev/PS0 - 1.44Mb</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>188</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
cmp&nbsp;&nbsp;&nbsp;&nbsp; bx,#18</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>189</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
je&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root_defined</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>190</span></u><span
lang=EN-US> undef_root:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>如果都不一样，则死循环（死机）。</p>

<p class=a><u><span lang=EN-US style='color:blue'>191</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jmp undef_root</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>192</span></u><span
lang=EN-US> root_defined:</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>193</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; seg cs</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>194</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; root_dev,ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>将检查过的设备号保存到<span lang=EN-US>root_dev</span>中。</p>

<p class=a><u><span lang=EN-US style='color:blue'>195</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>196</span></u><span
lang=EN-US> ! after that (everyting loaded), we jump to</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>197</span></u><span
lang=EN-US> ! the setup-routine loaded directly after</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>198</span></u><span
lang=EN-US> ! the bootblock:</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>到此，所有程序都加载完毕，我们就跳转到被加载在<span
lang=EN-US>bootsect</span>后面的<span lang=EN-US>setup</span>程序去。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp; &nbsp;! </span>下面段间跳转指令（<span
lang=EN-US>Jump Intersegment</span>）。跳转到<span lang=EN-US>0x9020:0000(setup.s</span>程序开始处<span
lang=EN-US>)</span>去执行。</p>

<p class=a><u><span lang=EN-US style='color:blue'>199</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>200</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
jmpi&nbsp;&nbsp;&nbsp; 0,SETUPSEG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
!!!! </span>到此本程序就结束了。<span lang=EN-US>!!!!</span></p>

<p class=a><span lang=EN-US>&nbsp;</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>下面是几个子程序。<span
lang=EN-US>read_it</span>用于读取磁盘上的<span lang=EN-US>system</span>模块。<span
lang=EN-US>kill_moter</span>用于关闭软驱马达。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>还有一些屏幕显示子程序。</p>

<p class=a><u><span lang=EN-US style='color:blue'>201</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>202</span></u><span
lang=EN-US> ! This routine loads the system at address 0x10000, making sure</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>203</span></u><span
lang=EN-US> ! no 64kB boundaries are crossed. We try to load it as fast as</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>204</span></u><span
lang=EN-US> ! possible, loading whole tracks whenever we can.</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>205</span></u><span
lang=EN-US> !</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>206</span></u><span
lang=EN-US> ! in:&nbsp;&nbsp; es - starting address segment (normally 0x1000)</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>207</span></u><span
lang=EN-US> !</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>该子程序将系统模块加载到内存地址<span
lang=EN-US>0x10000</span>处，并确定没有跨越<span lang=EN-US>64KB</span>的内存边界。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>我们试图尽快地进行加载，只要可能，就每次加载整条磁道的数据。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>输入：<span lang=EN-US>es
– </span>开始内存地址段值（通常是<span lang=EN-US>0x1000</span>）</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; !</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>下面伪操作符<span lang=EN-US>.word</span>定义一个<span
lang=EN-US>2</span>字节目标。相当于<span lang=EN-US>C</span>语言程序中定义的变量和所占内存空间大小。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! '1+SETUPLEN'</span>表示开始时已经读进<span
lang=EN-US>1</span>个引导扇区和<span lang=EN-US>setup</span>程序所占的扇区数<span lang=EN-US>SETUPLEN</span>。</p>

<p class=a><u><span lang=EN-US style='color:blue'>208</span></u><span
lang=EN-US> sread:&nbsp; .word
1+SETUPLEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! sectors read of current
track !</span>当前磁道中已读扇区数。</p>

<p class=a><u><span lang=EN-US style='color:blue'>209</span></u><span
lang=EN-US> head:&nbsp;&nbsp; .word
0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! current head&nbsp;&nbsp;&nbsp; !</span>当前磁头号。</p>

<p class=a><u><span lang=EN-US style='color:blue'>210</span></u><span
lang=EN-US> track:&nbsp; .word
0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! current track &nbsp;&nbsp;!</span>当前磁道号。</p>

<p class=a><u><span lang=EN-US style='color:blue'>211</span></u><span
lang=EN-US> </span></p>

<p class=a><u><span lang=EN-US style='color:blue'>212</span></u><span
lang=EN-US> read_it:</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>首先测试输入的段值。从盘上读入的数据必须存放在位于内存地址<span
lang=EN-US> 64KB </span>的边界开始处，否则</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>进入死循环。清<span
lang=EN-US>bx</span>寄存器，用于表示当前段内存放数据的开始位置。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! 153</span>行上的指令<span
lang=EN-US>test</span>以比特位逻辑与两个操作数。若两个操作数对应的比特位都为<span lang=EN-US>1</span>，则结果</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>值的对应比特位为<span
lang=EN-US>1</span>，否则为<span lang=EN-US>0</span>。该操作结果只影响标志（零标志<span
lang=EN-US>ZF</span>等）。例如若<span lang=EN-US>AX=0x1000</span>，</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>那么<span lang=EN-US>test</span>指令的执行结果是<span
lang=EN-US>(0x1000 &amp; 0x0fff) = 0x0000</span>，于是<span lang=EN-US>ZF</span>标志置位。此时即下一条</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>指令<span lang=EN-US>jne </span>条件不成立。</p>

<p class=a><u><span lang=EN-US style='color:blue'>213</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov ax,es</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>214</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test ax,#0x0fff</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>215</span></u><span
lang=EN-US> die:&nbsp;&nbsp;&nbsp; jne
die&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! es must be at 64kB boundary ! es</span>值必须位于<span lang=EN-US>64KB</span>边界<span
lang=EN-US>!</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>216</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xor bx,bx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! bx is starting address within segment! bx</span>为段内偏移。</p>

<p class=a><u><span lang=EN-US style='color:blue'>217</span></u><span
lang=EN-US> rp_read:</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>接着判断是否已经读入全部数据。比较当前所读段是否就是系统数据末端所处的段<span
lang=EN-US>(#ENDSEG)</span>，</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>如果不是就跳转至下面<span
lang=EN-US>ok1_read</span>标号处继续读数据。否则退出子程序返回。</p>

<p class=a><u><span lang=EN-US style='color:blue'>218</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov ax,es</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>219</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cmp
ax,#ENDSEG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! have we
loaded all yet? &nbsp;&nbsp;&nbsp;! </span>是否已经加载了全部数据？</p>

<p class=a><u><span lang=EN-US style='color:blue'>220</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jb ok1_read</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>221</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>222</span></u><span
lang=EN-US> ok1_read:</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>然后计算和验证当前磁道需要读取的扇区数，放在<span
lang=EN-US>ax</span>寄存器中。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>根据当前磁道还未读取的扇区数以及段内数据字节开始偏移位置，计算如果全部读取这些未读</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>扇区，所读总字节数是否会超过<span
lang=EN-US>64KB</span>段长度的限制。若会超过，则根据此次最多能读入的字节</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>数 <span lang=EN-US>(64KB
–</span>段内偏移位置<span lang=EN-US>)</span>，反算出此次需要读取的扇区数。</p>

<p class=a><u><span lang=EN-US style='color:blue'>223</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;seg cs</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>224</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov ax,sectors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>取每磁道扇区数。</p>

<p class=a><u><span lang=EN-US style='color:blue'>225</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sub ax,sread&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;! </span>减去当前磁道已读扇区数。</p>

<p class=a><u><span lang=EN-US style='color:blue'>226</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov cx,ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;! cx = ax = </span>当前磁道未读扇区数。</p>

<p class=a><u><span lang=EN-US style='color:blue'>227</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; shl cx,#9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! cx = cx * 512 </span>字节<span lang=EN-US> + </span>段内当前偏移值<span lang=EN-US>(bx)</span>。</p>

<p class=a><u><span lang=EN-US style='color:blue'>228</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add cx,bx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;!&nbsp;&nbsp; = </span>此次读操作后，段内共读入的字节数。</p>

<p class=a><u><span lang=EN-US style='color:blue'>229</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jnc ok2_read&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;! </span>若没有超过<span lang=EN-US>64KB</span>字节，则跳转至<span
lang=EN-US>ok2_read</span>处执行。</p>

<p class=a><u><span lang=EN-US style='color:blue'>230</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; je ok2_read</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp; &nbsp;! </span>若加上此次将读磁道上所有未读扇区时会超过<span
lang=EN-US>64KB</span>，则计算此时最多能读入的字节数：</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! (64KB–</span>段内读偏移位置<span
lang=EN-US>)</span>，再转换成需读取的扇区数。其中<span lang=EN-US>0</span>减某数就是取该数<span
lang=EN-US>64KB</span>的补值。</p>

<p class=a><u><span lang=EN-US style='color:blue'>231</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xor ax,ax</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>232</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sub ax,bx</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>233</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; shr ax,#9</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>234</span></u><span
lang=EN-US> ok2_read:</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>读当前磁道上指定开始扇区（<span
lang=EN-US>cl</span>）和需读扇区数（<span lang=EN-US>al</span>）的数据到 <span lang=EN-US>es:bx</span>开始处。然后统计当前</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>磁道上已经读取的扇区数并与磁道最大扇区数 <span
lang=EN-US>sectors</span>作比较。如果小于<span lang=EN-US>sectors</span>说明当前磁</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>道上的还有扇区未读。于是跳转到<span
lang=EN-US>ok3_read</span>处继续操作。</p>

<p class=a><u><span lang=EN-US style='color:blue'>235</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; call read_track&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! </span>读当前磁道上指定开始扇区和需读扇区数的数据。</p>

<p class=a><u><span lang=EN-US style='color:blue'>236</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov cx,ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! cx = </span>该次操作已读取的扇区数。</p>

<p class=a><u><span lang=EN-US style='color:blue'>237</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add ax,sread&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;! </span>加上当前磁道上已经读取的扇区数。</p>

<p class=a><u><span lang=EN-US style='color:blue'>238</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; seg cs</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>239</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cmp ax,sectors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;! </span>若当前磁道上的还有扇区未读，则跳转到<span lang=EN-US>ok3_read</span>处。</p>

<p class=a><u><span lang=EN-US style='color:blue'>240</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jne ok3_read</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>若该磁道的当前磁头面所有扇区已经读取，则读该磁道的下一磁头面（<span
lang=EN-US>1</span>号磁头）上的数据。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>如果已经完成，则去读下一磁道。</p>

<p class=a><u><span lang=EN-US style='color:blue'>241</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov ax,#1</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>242</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sub ax,head&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;! </span>判断当前磁头号。</p>

<p class=a><u><span lang=EN-US style='color:blue'>243</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jne ok4_read&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;! </span>如果是<span lang=EN-US>0</span>磁头，则再去读<span lang=EN-US>1</span>磁头面上的扇区数据。</p>

<p class=a><u><span lang=EN-US style='color:blue'>244</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc track&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! </span>否则去读下一磁道。</p>

<p class=a><u><span lang=EN-US style='color:blue'>245</span></u><span
lang=EN-US> ok4_read:</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>246</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov head,ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;! </span>保存当前磁头号。</p>

<p class=a><u><span lang=EN-US style='color:blue'>247</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xor ax,ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;! </span>清当前磁道已读扇区数。</p>

<p class=a><u><span lang=EN-US style='color:blue'>248</span></u><span
lang=EN-US> ok3_read:</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>如果当前磁道上的还有未读扇区，则首先保存当前磁道已读扇区数，然后调整存放数据处的开</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>始位置。若小于<span
lang=EN-US>64KB</span>边界值，则跳转到<span lang=EN-US>rp_read(217</span>行<span
lang=EN-US>)</span>处，继续读数据。</p>

<p class=a><u><span lang=EN-US style='color:blue'>249</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov sread,ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;! </span>保存当前磁道已读扇区数。</p>

<p class=a><u><span lang=EN-US style='color:blue'>250</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; shl cx,#9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;! </span>上次已读扇区数<span lang=EN-US>*512</span>字节。</p>

<p class=a><u><span lang=EN-US style='color:blue'>251</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add bx,cx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;! </span>调整当前段内数据开始位置。</p>

<p class=a><u><span lang=EN-US style='color:blue'>252</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jnc rp_read</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>否则说明已经读取<span
lang=EN-US>64KB</span>数据。此时调整当前段，为读下一段数据作准备。</p>

<p class=a><u><span lang=EN-US style='color:blue'>253</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov ax,es</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>254</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add ah,#0x10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! </span>将段基址调整为指向下一个<span
lang=EN-US>64KB</span>内存开始处。</p>

<p class=a><u><span lang=EN-US style='color:blue'>255</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov es,ax</span></p>

<p class=a><u><span lang=EN-US style='color:blue'>256</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xor bx,bx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;! </span>清段内数据开始偏移值。</p>

<p class=a><u><span lang=EN-US style='color:blue'>257</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jmp rp_read&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;! </span>跳转至<span lang=EN-US>rp_read(217</span>行<span
lang=EN-US>)</span>处，继续读数据。</p>

<p class=a><u><span lang=EN-US style='color:blue'>258</span></u><span
lang=EN-US> </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! read_track </span>子程序。读当前磁道上指定开始扇区和需读扇区数的数据到
<span lang=EN-US>es:bx </span>开始处。参见</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>第<span lang=EN-US>67</span>行下对<span
lang=EN-US>BIOS</span>磁盘读中断<span lang=EN-US>int 0x13</span>，<span lang=EN-US>ah=2</span>的说明。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! al – </span>需读扇区数；<span
lang=EN-US>es:bx – </span>缓冲区开始位置。</p>

<p class=a><u><span lang=EN-US style='color:blue'>259</span></u><span
lang=EN-US> read_track:</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>首先调用<span lang=EN-US>BIOS</span>中断<span
lang=EN-US>0x10</span>，功能<span lang=EN-US>0x0e</span>（以电传方式写字符），光标前移一位置。显示一个<span
lang=EN-US>'.'</span>。</p>

<p class=a><u><span lang=EN-US style='color:blue'>260</span></u><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pusha&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>压入所有寄存器（<span lang=EN-US>push all</span>）。</p>

<p class=a><a name=L261><u><span lang=EN-US style='color:blue'>261</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pusha&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
</span>为调用显示中断压入所有寄存器值。</p>

<p class=a><a name=L262><u><span lang=EN-US style='color:blue'>262</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov ax,
#0xe2e&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
loading... message 2e = .</span></p>

<p class=a><a name=L263><u><span lang=EN-US style='color:blue'>263</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov bx, #7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>字符前景色属性。</p>

<p class=a><a name=L264><u><span lang=EN-US style='color:blue'>264</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int 0x10</span></p>

<p class=a><a name=L265><u><span lang=EN-US style='color:blue'>265</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
popa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>

<p class=a><a name=L266><u><span lang=EN-US style='color:blue'>266</span></u></a><span
lang=EN-US> </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>然后正式进行磁道扇区读操作。</p>

<p class=a><a name=L267><u><span lang=EN-US style='color:blue'>267</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov dx,track&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! </span>取当前磁道号。</p>

<p class=a><a name=L268><u><span lang=EN-US style='color:blue'>268</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov cx,sread&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>取当前磁道上已读扇区数。</p>

<p class=a><a name=L269><u><span lang=EN-US style='color:blue'>269</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc cx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! cl = </span>开始读扇区。</p>

<p class=a><a name=L270><u><span lang=EN-US style='color:blue'>270</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov ch,dl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! ch = </span>当前磁道号。</p>

<p class=a><a name=L271><u><span lang=EN-US style='color:blue'>271</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov dx,head&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! </span>取当前磁头号。</p>

<p class=a><a name=L272><u><span lang=EN-US style='color:blue'>272</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov dh,dl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! dh = </span>磁头号，<span lang=EN-US>dl = </span>驱动器号<span
lang=EN-US>(</span>为<span lang=EN-US>0</span>表示当前<span lang=EN-US>A</span>驱动器<span
lang=EN-US>)</span>。</p>

<p class=a><a name=L273><u><span lang=EN-US style='color:blue'>273</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and dx,#0x0100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;! </span>磁头号不大于<span lang=EN-US>1</span>。</p>

<p class=a><a name=L274><u><span lang=EN-US style='color:blue'>274</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov ah,#2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! ah = 2</span>，读磁盘扇区功能号。</p>

<p class=a><a name=L275><u><span lang=EN-US style='color:blue'>275</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>

<p class=a><a name=L276><u><span lang=EN-US style='color:blue'>276</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push dx &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
save for error dump</span></p>

<p class=a><a name=L277><u><span lang=EN-US style='color:blue'>277</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push cx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! </span>为出错情况保存一些信息。</p>

<p class=a><a name=L278><u><span lang=EN-US style='color:blue'>278</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push bx</span></p>

<p class=a><a name=L279><u><span lang=EN-US style='color:blue'>279</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push ax</span></p>

<p class=a><a name=L280><u><span lang=EN-US style='color:blue'>280</span></u></a><span
lang=EN-US> </span></p>

<p class=a><a name=L281><u><span lang=EN-US style='color:blue'>281</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int 0x13</span></p>

<p class=a><a name=L282><u><span lang=EN-US style='color:blue'>282</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jc bad_rt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! </span>若出错，则跳转至<span lang=EN-US>bad_rt</span>。</p>

<p class=a><a name=L283><u><span lang=EN-US style='color:blue'>283</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add sp,#8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! </span>没有出错。因此丢弃为出错情况保存的信息。</p>

<p class=a><a name=L284><u><span lang=EN-US style='color:blue'>284</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; popa</span></p>

<p class=a><a name=L285><u><span lang=EN-US style='color:blue'>285</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret</span></p>

<p class=a><a name=L286><u><span lang=EN-US style='color:blue'>286</span></u></a><span
lang=EN-US> </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>读磁盘操作出错。则先显示出错信息，然后执行驱动器复位操作（磁盘中断功能号<span
lang=EN-US>0</span>），再跳转</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>到<span lang=EN-US>read_track</span>处重试。</p>

<p class=a><a name=L287><u><span lang=EN-US style='color:blue'>287</span></u></a><span
lang=EN-US> bad_rt: push
ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! save error code</span></p>

<p class=a><a name=L288><u><span lang=EN-US style='color:blue'>288</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; call
print_all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! ah = error, al = read</span></p>

<p class=a><a name=L289><u><span lang=EN-US style='color:blue'>289</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>

<p class=a><a name=L290><u><span lang=EN-US style='color:blue'>290</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>

<p class=a><a name=L291><u><span lang=EN-US style='color:blue'>291</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xor ah,ah</span></p>

<p class=a><a name=L292><u><span lang=EN-US style='color:blue'>292</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xor dl,dl</span></p>

<p class=a><a name=L293><u><span lang=EN-US style='color:blue'>293</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int 0x13</span></p>

<p class=a><a name=L294><u><span lang=EN-US style='color:blue'>294</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>

<p class=a><a name=L295><u><span lang=EN-US style='color:blue'>295</span></u></a><span
lang=EN-US> </span></p>

<p class=a><a name=L296><u><span lang=EN-US style='color:blue'>296</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add sp, #10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! </span>丢弃为出错情况保存的信息。</p>

<p class=a><a name=L297><u><span lang=EN-US style='color:blue'>297</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
popa&nbsp;&nbsp;&nbsp; </span></p>

<p class=a><a name=L298><u><span lang=EN-US style='color:blue'>298</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jmp read_track</span></p>

<p class=a><a name=L299><u><span lang=EN-US style='color:blue'>299</span></u></a><span
lang=EN-US> </span></p>

<p class=a><a name=L300><u><span lang=EN-US style='color:blue'>300</span></u></a><span
lang=EN-US> /*</span></p>

<p class=a><a name=L301><u><span lang=EN-US style='color:blue'>301</span></u></a><span
lang=EN-US>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print_all is for debugging
purposes.&nbsp; </span></p>

<p class=a><a name=L302><u><span lang=EN-US style='color:blue'>302</span></u></a><span
lang=EN-US>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; It will print out all of the
registers.&nbsp; The assumption is that this is</span></p>

<p class=a><a name=L303><u><span lang=EN-US style='color:blue'>303</span></u></a><span
lang=EN-US>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; called from a routine, with a
stack frame like</span></p>

<p class=a><a name=L304><u><span lang=EN-US style='color:blue'>304</span></u></a><span
lang=EN-US>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dx </span></p>

<p class=a><a name=L305><u><span lang=EN-US style='color:blue'>305</span></u></a><span
lang=EN-US>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cx</span></p>

<p class=a><a name=L306><u><span lang=EN-US style='color:blue'>306</span></u></a><span
lang=EN-US>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bx</span></p>

<p class=a><a name=L307><u><span lang=EN-US style='color:blue'>307</span></u></a><span
lang=EN-US>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ax</span></p>

<p class=a><a name=L308><u><span lang=EN-US style='color:blue'>308</span></u></a><span
lang=EN-US>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; error</span></p>

<p class=a><a name=L309><u><span lang=EN-US style='color:blue'>309</span></u></a><span
lang=EN-US>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret &lt;- sp</span></p>

<p class=a><a name=L310><u><span lang=EN-US style='color:blue'>310</span></u></a><span
lang=EN-US>&nbsp; *</span></p>

<p class=a><a name=L311><u><span lang=EN-US style='color:blue'>311</span></u></a><span
lang=EN-US> */</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; /*</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>子程序<span lang=EN-US>print_all</span>用于调试目的。它会显示所有寄存器的内容。前提条件是需要从</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>一个子程序中调用，并且栈帧结构为如下所示：（见上面）</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp; */</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>若标志寄存器的<span
lang=EN-US>CF=0</span>，则不显示寄存器名称。</p>

<p class=a><a name=L312><u><span lang=EN-US style='color:blue'>312</span></u></a><span
lang=EN-US>&nbsp; </span></p>

<p class=a><a name=L313><u><span lang=EN-US style='color:blue'>313</span></u></a><span
lang=EN-US> print_all:</span></p>

<p class=a><a name=L314><u><span lang=EN-US style='color:blue'>314</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov cx,
#5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
error code + 4 registers&nbsp; ! </span>显示值个数。</p>

<p class=a><a name=L315><u><span lang=EN-US style='color:blue'>315</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov bp, sp &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
</span>保存当前栈指针<span lang=EN-US>sp</span>。</p>

<p class=a><a name=L316><u><span lang=EN-US style='color:blue'>316</span></u></a><span
lang=EN-US> </span></p>

<p class=a><a name=L317><u><span lang=EN-US style='color:blue'>317</span></u></a><span
lang=EN-US> print_loop:</span></p>

<p class=a><a name=L318><u><span lang=EN-US style='color:blue'>318</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push
cx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! save count left&nbsp;&nbsp; ! </span>保存需要显示的剩余个数。</p>

<p class=a><a name=L319><u><span lang=EN-US style='color:blue'>319</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; call
print_nl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
nl for readability&nbsp; ! </span>为可读性先让光标回车换行。</p>

<p class=a><a name=L320><u><span lang=EN-US style='color:blue'>320</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jae
no_reg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
see if register name is needed</span></p>

<p class=a><a name=L321><u><span lang=EN-US style='color:blue'>321</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
</span>若<span lang=EN-US>FLAGS</span>的标志<span lang=EN-US>CF=0</span>则不显示寄存器名，于是跳转。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>对应入栈寄存器顺序分别显示它们的名称“<span
lang=EN-US>AX</span>：”等。</p>

<p class=a><a name=L322><u><span lang=EN-US style='color:blue'>322</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov ax, #0xe05 +
0x41 - 1&nbsp; ! ah =</span>功能号（<span lang=EN-US>0x0e</span>）；<span lang=EN-US>al
=</span>字符（<span lang=EN-US>0x05 + 0x41 -1</span>）。</p>

<p class=a><a name=L323><u><span lang=EN-US style='color:blue'>323</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sub al, cl</span></p>

<p class=a><a name=L324><u><span lang=EN-US style='color:blue'>324</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int 0x10</span></p>

<p class=a><a name=L325><u><span lang=EN-US style='color:blue'>325</span></u></a><span
lang=EN-US> </span></p>

<p class=a><a name=L326><u><span lang=EN-US style='color:blue'>326</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov al,
#0x58&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
X&nbsp;&nbsp;&nbsp;&nbsp; ! </span>显示字符<span lang=EN-US>'X'</span>。</p>

<p class=a><a name=L327><u><span lang=EN-US style='color:blue'>327</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int 0x10</span></p>

<p class=a><a name=L328><u><span lang=EN-US style='color:blue'>328</span></u></a><span
lang=EN-US> </span></p>

<p class=a><a name=L329><u><span lang=EN-US style='color:blue'>329</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov al, #0x3a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! :&nbsp;&nbsp;&nbsp;&nbsp; ! </span>显示字符<span lang=EN-US>':'</span>。</p>

<p class=a><a name=L330><u><span lang=EN-US style='color:blue'>330</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int 0x10</span></p>

<p class=a><a name=L331><u><span lang=EN-US style='color:blue'>331</span></u></a><span
lang=EN-US> </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>显示寄存器<span lang=EN-US>bp</span>所指栈中内容。开始时<span
lang=EN-US>bp</span>指向返回地址。</p>

<p class=a><a name=L332><u><span lang=EN-US style='color:blue'>332</span></u></a><span
lang=EN-US> no_reg:</span></p>

<p class=a><a name=L333><u><span lang=EN-US style='color:blue'>333</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add bp,
#2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
next register&nbsp;&nbsp; ! </span>栈中下一个位置。</p>

<p class=a><a name=L334><u><span lang=EN-US style='color:blue'>334</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; call
print_hex&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
print it&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! </span>以十六进制显示。</p>

<p class=a><a name=L335><u><span lang=EN-US style='color:blue'>335</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pop cx</span></p>

<p class=a><a name=L336><u><span lang=EN-US style='color:blue'>336</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loop print_loop</span></p>

<p class=a><a name=L337><u><span lang=EN-US style='color:blue'>337</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret</span></p>

<p class=a><a name=L338><u><span lang=EN-US style='color:blue'>338</span></u></a><span
lang=EN-US> </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>调用<span lang=EN-US>BIOS</span>中断<span
lang=EN-US>0x10</span>，以电传方式显示回车换行。</p>

<p class=a><a name=L339><u><span lang=EN-US style='color:blue'>339</span></u></a><span
lang=EN-US> print_nl:</span></p>

<p class=a><a name=L340><u><span lang=EN-US style='color:blue'>340</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov ax,
#0xe0d&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
CR</span></p>

<p class=a><a name=L341><u><span lang=EN-US style='color:blue'>341</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int 0x10</span></p>

<p class=a><a name=L342><u><span lang=EN-US style='color:blue'>342</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov al,
#0xa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
LF</span></p>

<p class=a><a name=L343><u><span lang=EN-US style='color:blue'>343</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int 0x10</span></p>

<p class=a><a name=L344><u><span lang=EN-US style='color:blue'>344</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret</span></p>

<p class=a><a name=L345><u><span lang=EN-US style='color:blue'>345</span></u></a><span
lang=EN-US> </span></p>

<p class=a><a name=L346><u><span lang=EN-US style='color:blue'>346</span></u></a><span
lang=EN-US> /*</span></p>

<p class=a><a name=L347><u><span lang=EN-US style='color:blue'>347</span></u></a><span
lang=EN-US>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print_hex is for debugging
purposes, and prints the word</span></p>

<p class=a><a name=L348><u><span lang=EN-US style='color:blue'>348</span></u></a><span
lang=EN-US>&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pointed to by ss:bp in
hexadecmial.</span></p>

<p class=a><a name=L349><u><span lang=EN-US style='color:blue'>349</span></u></a><span
lang=EN-US> */</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; /*</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>子程序<span lang=EN-US>print_hex</span>用于调试目的。它使用十六进制在屏幕上显示出</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ss:bp</span>指向的字。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp; */</span></p>

<p class=a><a name=L350><u><span lang=EN-US style='color:blue'>350</span></u></a><span
lang=EN-US> </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>调用<span lang=EN-US>BIOS</span>中断<span
lang=EN-US>0x10</span>，以电传方式和<span lang=EN-US>4</span>个十六进制数显示<span lang=EN-US>ss:bp</span>指向的字。</p>

<p class=a><a name=L351><u><span lang=EN-US style='color:blue'>351</span></u></a><span
lang=EN-US> print_hex:</span></p>

<p class=a><a name=L352><u><span lang=EN-US style='color:blue'>352</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; cx,
#4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;! 4
hex digits&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! </span>要显示<span
lang=EN-US>4</span>个十六进制数字。</p>

<p class=a><a name=L353><u><span lang=EN-US style='color:blue'>353</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; dx, (bp)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;!
load word into dx&nbsp;&nbsp;&nbsp; ! </span>显示值放入<span lang=EN-US>dx</span>中。</p>

<p class=a><a name=L354><u><span lang=EN-US style='color:blue'>354</span></u></a><span
lang=EN-US> print_digit:</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>先显示高字节，因此需要把<span
lang=EN-US>dx</span>中值左旋<span lang=EN-US>4</span>比特，此时高<span lang=EN-US>4</span>比特在<span
lang=EN-US>dx</span>的低<span lang=EN-US>4</span>位中。</p>

<p class=a><a name=L355><u><span lang=EN-US style='color:blue'>355</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
rol&nbsp;&nbsp;&nbsp;&nbsp; dx,
#4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;!
rotate so that lowest 4 bits are used</span></p>

<p class=a><a name=L356><u><span lang=EN-US style='color:blue'>356</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; ah, #0xe&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
</span>中断功能号。</p>

<p class=a><a name=L357><u><span lang=EN-US style='color:blue'>357</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp;&nbsp;&nbsp; al, dl&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
mask off so we have only next nibble</span></p>

<p class=a><a name=L358><u><span lang=EN-US style='color:blue'>358</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
and&nbsp;&nbsp;&nbsp;&nbsp; al, #0xf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>放入<span lang=EN-US>al</span>中并只取低<span lang=EN-US>4</span>比特（<span
lang=EN-US>1</span>个值）。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>加上<span lang=EN-US>'0' </span>的<span
lang=EN-US>ASCII</span>码值<span lang=EN-US>0x30</span>，把显示值转换成基于数字<span
lang=EN-US>'0' </span>的字符。若此时<span lang=EN-US>al </span>值超过 <span lang=EN-US>0x39</span>，</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>表示欲显示值超过数字<span
lang=EN-US>9</span>，因此需要使用<span lang=EN-US>'A'--'F'</span>来表示。</p>

<p class=a><a name=L359><u><span lang=EN-US style='color:blue'>359</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
add&nbsp;&nbsp;&nbsp;&nbsp; al, #0x30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;!
convert to 0 based digit, '0'</span></p>

<p class=a><a name=L360><u><span lang=EN-US style='color:blue'>360</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
cmp&nbsp;&nbsp;&nbsp;&nbsp; al, #0x39&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;!
check for overflow</span></p>

<p class=a><a name=L361><u><span lang=EN-US style='color:blue'>361</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
jbe&nbsp;&nbsp;&nbsp;&nbsp; good_digit</span></p>

<p class=a><a name=L362><u><span lang=EN-US style='color:blue'>362</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
add&nbsp;&nbsp;&nbsp;&nbsp; al, #0x41 - 0x30 - 0xa&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
'A' - '0' - 0xa</span></p>

<p class=a><a name=L363><u><span lang=EN-US style='color:blue'>363</span></u></a><span
lang=EN-US> </span></p>

<p class=a><a name=L364><u><span lang=EN-US style='color:blue'>364</span></u></a><span
lang=EN-US> good_digit:</span></p>

<p class=a><a name=L365><u><span lang=EN-US style='color:blue'>365</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int&nbsp;&nbsp;&nbsp;&nbsp; 0x10</span></p>

<p class=a><a name=L366><u><span lang=EN-US style='color:blue'>366</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
loop&nbsp;&nbsp;&nbsp; print_digit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !
cx--</span>。若<span lang=EN-US>cx&gt;0</span>则去显示下一个值。</p>

<p class=a><a name=L367><u><span lang=EN-US style='color:blue'>367</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret</span></p>

<p class=a><a name=L368><u><span lang=EN-US style='color:blue'>368</span></u></a><span
lang=EN-US> </span></p>

<p class=a><a name=L369><u><span lang=EN-US style='color:blue'>369</span></u></a><span
lang=EN-US> </span></p>

<p class=a><a name=L370><u><span lang=EN-US style='color:blue'>370</span></u></a><span
lang=EN-US> /*</span></p>

<p class=a><a name=L371><u><span lang=EN-US style='color:blue'>371</span></u></a><span
lang=EN-US>&nbsp; * This procedure turns off the floppy drive motor, so</span></p>

<p class=a><a name=L372><u><span lang=EN-US style='color:blue'>372</span></u></a><span
lang=EN-US>&nbsp; * that we enter the kernel in a known state, and</span></p>

<p class=a><a name=L373><u><span lang=EN-US style='color:blue'>373</span></u></a><span
lang=EN-US>&nbsp; * don't have to worry about it later.</span></p>

<p class=a><a name=L374><u><span lang=EN-US style='color:blue'>374</span></u></a><span
lang=EN-US>&nbsp; */</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; /* </span>这个子程序用于关闭软驱的马达，这样我们进入内核后就能</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp; * </span>知道它所处的状态，以后也就无须担心它了。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp; */</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>下面第<span lang=EN-US>377</span>行上的值<span
lang=EN-US>0x3f2</span>是软盘控制器的一个端口，被称为数字输出寄存器（<span
lang=EN-US>DOR</span>）端口。它是</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>一个<span lang=EN-US>8</span>位的寄存器，其位<span
lang=EN-US>7--</span>位<span lang=EN-US>4</span>分别用于控制<span lang=EN-US>4</span>个软驱（<span
lang=EN-US>D--A</span>）的启动和关闭。位<span lang=EN-US>3--</span>位<span lang=EN-US>2</span>用于</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>允许<span lang=EN-US>/</span>禁止<span
lang=EN-US>DMA</span>和中断请求以及启动<span lang=EN-US>/</span>复位软盘控制器<span lang=EN-US>FDC</span>。
位<span lang=EN-US>1--</span>位<span lang=EN-US>0</span>用于选择选择操作的软驱。</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>第<span lang=EN-US>378</span>行上在<span
lang=EN-US>al</span>中设置并输出的<span lang=EN-US>0</span>值，就是用于选择<span lang=EN-US>A</span>驱动器，关闭<span
lang=EN-US>FDC</span>，禁止<span lang=EN-US>DMA</span>和中断请求，</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>关闭马达。有关软驱控制卡编程的详细信息请参见<span
lang=EN-US>kernel/blk_drv/floppy.c</span>程序后面的说明。</p>

<p class=a><a name=L375><u><span lang=EN-US style='color:blue'>375</span></u></a><span
lang=EN-US> kill_motor:</span></p>

<p class=a><a name=L376><u><span lang=EN-US style='color:blue'>376</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push dx</span></p>

<p class=a><a name=L377><u><span lang=EN-US style='color:blue'>377</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov dx,#0x3f2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! </span>软驱控制卡的数字输出寄存器端口，只写。</p>

<p class=a><a name=L378><u><span lang=EN-US style='color:blue'>378</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xor al, al&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! A</span>驱动器，关闭<span lang=EN-US>FDC</span>，禁止<span lang=EN-US>DMA</span>和中断请求，关闭马达。</p>

<p class=a><a name=L379><u><span lang=EN-US style='color:blue'>379</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!
</span>将<span lang=EN-US>al</span>中的内容输出到<span lang=EN-US>dx</span>指定的端口去。</p>

<p class=a><a name=L380><u><span lang=EN-US style='color:blue'>380</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pop dx</span></p>

<p class=a><a name=L381><u><span lang=EN-US style='color:blue'>381</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret</span></p>

<p class=a><a name=L382><u><span lang=EN-US style='color:blue'>382</span></u></a><span
lang=EN-US> </span></p>

<p class=a><a name=L383><u><span lang=EN-US style='color:blue'>383</span></u></a><span
lang=EN-US> sectors:</span></p>

<p class=a><a name=L384><u><span lang=EN-US style='color:blue'>384</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .word 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>存放当前启动软盘每磁道的扇区数。</p>

<p class=a><a name=L385><u><span lang=EN-US style='color:blue'>385</span></u></a><span
lang=EN-US> </span></p>

<p class=a><a name=L386><u><span lang=EN-US style='color:blue'>386</span></u></a><span
lang=EN-US> msg1:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>开机调用<span lang=EN-US>BIOS</span>中断显示的信息。共<span lang=EN-US>9</span>个字符。</p>

<p class=a><a name=L387><u><span lang=EN-US style='color:blue'>387</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .byte 13,10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>回车、换行的<span lang=EN-US>ASCII</span>码。</p>

<p class=a><a name=L388><u><span lang=EN-US style='color:blue'>388</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .ascii
&quot;Loading&quot;</span></p>

<p class=a><a name=L389><u><span lang=EN-US style='color:blue'>389</span></u></a><span
lang=EN-US> </span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>表示下面语句从地址<span
lang=EN-US>508(0x1FC)</span>开始，所以<span lang=EN-US>root_dev</span>在启动扇区的第<span
lang=EN-US>508</span>开始的<span lang=EN-US>2</span>个字节中。</p>

<p class=a><a name=L390><u><span lang=EN-US style='color:blue'>390</span></u></a><span
lang=EN-US> .org 506</span></p>

<p class=a><a name=L391><u><span lang=EN-US style='color:blue'>391</span></u></a><span
lang=EN-US> swap_dev:</span></p>

<p class=a><a name=L392><u><span lang=EN-US style='color:blue'>392</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .word SWAP_DEV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>这里存放交换系统所在设备号<span lang=EN-US>(init/main.c</span>中会用<span lang=EN-US>)</span>。</p>

<p class=a><a name=L393><u><span lang=EN-US style='color:blue'>393</span></u></a><span
lang=EN-US> root_dev:</span></p>

<p class=a><a name=L394><u><span lang=EN-US style='color:blue'>394</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .word ROOT_DEV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
! </span>这里存放根文件系统所在设备号<span lang=EN-US>(init/main.c</span>中会用<span lang=EN-US>)</span>。</p>

<p class=a><span lang=EN-US>&nbsp;</span></p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>下面是启动盘具有有效引导扇区的标志。仅供<span
lang=EN-US>BIOS</span>中的程序加载引导扇区时识别使用。它必须</p>

<p class=a><span lang=EN-US>&nbsp;&nbsp;&nbsp; ! </span>位于引导扇区的最后两个字节中。</p>

<p class=a><a name=L395><u><span lang=EN-US style='color:blue'>395</span></u></a><span
lang=EN-US> boot_flag:</span></p>

<p class=a><a name=L396><u><span lang=EN-US style='color:blue'>396</span></u></a><span
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .word 0xAA55</span></p>

<p class=a><a name=L397><u><span lang=EN-US style='color:blue'>397</span></u></a><span
lang=EN-US> </span></p>

<p class=a><a name=L398><u><span lang=EN-US style='color:blue'>398</span></u></a><span
lang=EN-US> .text</span></p>

<p class=a><a name=L399><u><span lang=EN-US style='color:blue'>399</span></u></a><span
lang=EN-US> endtext:</span></p>

<p class=a><a name=L400><u><span lang=EN-US style='color:blue'>400</span></u></a><span
lang=EN-US> .data</span></p>

<p class=a><a name=L401><u><span lang=EN-US style='color:blue'>401</span></u></a><span
lang=EN-US> enddata:</span></p>

<p class=a><a name=L402><u><span lang=EN-US style='color:blue'>402</span></u></a><span
lang=EN-US> .bss</span></p>

<p class=a><a name=L403><u><span lang=EN-US style='color:blue'>403</span></u></a><span
lang=EN-US> endbss:</span></p>

<p class=a><a name=L404><u><span lang=EN-US style='color:blue'>404</span></u></a><span
lang=EN-US> </span></p>

<div class=a align=center style='text-align:center'><span lang=EN-US>

<hr size=4 width="100%" align=center>

</span></div>

<p class=MsoNormal><span lang=EN-US>&nbsp;</span></p>

</div>

</body>

</html>
